Re: deleteDocuments by Term[] for ALL terms

2007-12-04 Thread Antony Bowesman
Thanks Mike, just what I was after. Antony Michael McCandless wrote: You can just create a query with your and'd terms, and then do this: Weight weight = query.weight(indexSearcher); IndexReader reader = indexSearcher.getIndexReader(); Scorer scorer = weight.scorer(reader); int delCoun

Re: deleteDocuments by Term[] for ALL terms

2007-11-26 Thread Michael McCandless
You can just create a query with your and'd terms, and then do this: Weight weight = query.weight(indexSearcher); IndexReader reader = indexSearcher.getIndexReader(); Scorer scorer = weight.scorer(reader); int delCount = 0; while(scorer.next()) { reader.deleteDocument(scorer.doc());

deleteDocuments by Term[] for ALL terms

2007-11-25 Thread Antony Bowesman
Hi, I'm using IndexReader.deleteDocuments(Term) to delete documents in batches. I need the deleted count, so I cannot use IndexWriter.deleteDocuments(). What I want to do is delete documents based on more than one term, but not like IndexWriter.deleteDocuments(Term[]) which deletes all docum