lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From miztaken <man...@ccnep.com.np>
Subject Re: Strange Error while deleting Documents from index while indexing.
Date Fri, 27 Jul 2007 08:50:28 GMT

Where shall i post this issue.
I am naive to Lucene.
Now i have switched to lucene 1.9.1.4
And about IndexWriter Closing.
Now i am trying like this:

1. Open New IndexReader.
2. Delete Documents.
3. Close IndexReader.
4. Open New IndexWriter.
5. Write Documents.
6. Close IndexWriter.
7. Repeat the process for n times the in nth time optimize the index before
closing indexwriter.

By doing this i am not getting any of my previous problems but i got the new
problem.
When i close my application then i call indexwriter.optimize() and then
indexwriter.close() eventually.
For small amount of indexing, things are working fine but for larger
indexing indexwriter.optimze() terminated unexpectedly and it also didnt
threw any exception.
My application simply shut downs.
After that when i try to open the same index using IndexReader and fetch the
document then it says "trying to access deleted document". After getting
such error, i opened the indexWriter, optimized and then closed it.
Then again i tried to get the documents using indexreader and its working
all fine.

What can be the problem.

Well the pseudo code will be like:

Not Working pseudo-code
1. Open Application (declare int countWriting=0;)
2. Open IndexReader
3. Delete Document
4. Close IndexReader.
5. Open IndexWriter
6. Add Documents
7.  countWriting++;
8. Close IndexWriter.
9. If countWriting==10 then optimize();
10. if user donot cacel, repeat the whole process.
11. else try optimize
The program terminates abnormally in step 11.

But afterwards in the same index, when i try to open indexReader to fetch
documents then it says "trying to access deleted documents" but when i open
indexwriter optimize the index and then close it and open indexreader then
everything works fine.

-- 
View this message in context: http://www.nabble.com/Strange-Error-while-deleting-Documents-from-index-while-indexing.-tf4149570.html#a11823559
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message