Seems like a Lucene.Net issue, better post there to solve this. One comment - must close the writer between iterations otherwise next attempt to delete a document with a reader will fail to obtain a write lock.
miztaken <[EMAIL PROTECTED]> wrote on 25/07/2007 23:27:59: > > Hi, > I am dumping the database tables into lucene documents. > I am doing like this: > > 1. Get the rowset from database to be stored as Lucene Document. > 2. Open IndexReader and check if they are already indexed. > If Indexed, delete them and add the new rowset. > Continue this till the end > 3. Close IndexReader > 4. Open IndexWriter > 5. Write the same rowset in the index. > 6. delete the rowset from database.. > 7. Repeat the same process[step 1 - step 7 ] till there are records in > database. > > > Like this i am doing Indexing and deletion. > Some key points: > 1. New indexWriter is opened when there is not instance of indexwriter > available,but if available it makes use of the same IndexWriter. i.e. My > index Writer opens once in Step 4 and after that the whole > process makes use > of it. > 2. But i open indexReader for each deletion and close. > 3. I optimize IndexWriter after certain threshold is crossed. > > Now my problem is: > In the first deletion of document (if present) in step 2 and closing of > indexreader in step 3. I get no error. > But in the second loop, i get the error while trying to close the > IndexReader. > > The error is : > Unable to cast object of type 'System.Collections. > DictionaryEntry' to type > 'System.String'. > > Stack Trace: > at Lucene.Net.Index.IndexFileDeleter.DeleteFiles(ArrayList files) > at Lucene.Net.Index.IndexFileDeleter.DeleteFiles() > at Lucene.Net.Index.IndexFileDeleter.CommitPendingFiles() > at Lucene.Net.Index.IndexReader.Commit() > at Lucene.Net.Index.IndexReader.Close() > at QueryDatabaseForIndexing.Program.Main(String[] args) in E:\Test > Applications\ORS Lucene Developments\July 25\ > TotalIndexingAndSearching_25_july\T otalIndexingAndSearching\ > QueryDatabaseForIndexing \Program2.cs:line 159 > > I dont know whats the cause of this error. > > I am in real need of help. > Please help me find error. > > > > -- > View this message in context: http://www.nabble.com/Strange- > Error-while-deleting-Documents-from-index-while-indexing.- > tf4149570.html#a11804824 > 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] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]