Hi all. This may seem a longish and informal mail, but do correct me if my assumptions are wrong anywhere, otherwise my actual doubt will make no sense.
Say I opened an IndexWriter on an initially empty directory, using autocommit = true. Now, what I do is add and delete documents randomly. I set "x" as maxBufferedDocs and "y" as maxBufferedDeleteTerms (x < y). IndexWritrer starts its work. Now, I perfom the following sequences : STAGE 1 : Add "x-2" documents one after the another. Total docs in memory = x-2 (1) Delete 3 docs from memory Total docs in memory = x-5 (2) Add 5 docs one after another Total docs in memory = x (3) STAGE 2 : A flush happens, sice maxBufferedDocs reached. Total docs in memory = 0 (4) Thus, it is also a commit. STAGE 3 : Add x-10 docs one after other Total docs in memory = x-10 (5) NOW ... I call deleteDocuments(Term term), which has potential matches at two places : a) x-15 (out of x-10) documents currently residing in memory. b) x-20 (out of x) documents currently in the index directory. (6) IndexWriter.close() is called (7) Now, my question is, will the index contain (i) a total of (x) + (x-10) - (x-15) documents (ii) a total of (x) + (x-10) - (x-20) documents (iii) a total of (x) + (x-10) - (x-15) - (x-20) documents Secondly, will the answer change had I opened the IndexWriter in autocommit = false mode? Several other permutations of (autocommit mode), (points of flush call), (points of close call) exist, but I guess I will be fine if I get the answer to the first question itself. A little explanation will be highly obliged. Looking forward to responses. Ajay Garg -- View this message in context: http://www.nabble.com/Query-in-IndexWriter.deleteDocuments%28Term-term%29-tp18662995p18662995.html Sent from the Lucene - Java Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]