Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 48039 invoked from network); 26 Jul 2007 06:28:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Jul 2007 06:28:29 -0000 Received: (qmail 17561 invoked by uid 500); 26 Jul 2007 06:28:22 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 17526 invoked by uid 500); 26 Jul 2007 06:28:22 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 17515 invoked by uid 99); 26 Jul 2007 06:28:22 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2007 23:28:22 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2007 23:28:20 -0700 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1IDwpL-0000Cn-WA for java-user@lucene.apache.org; Wed, 25 Jul 2007 23:27:59 -0700 Message-ID: <11804824.post@talk.nabble.com> Date: Wed, 25 Jul 2007 23:27:59 -0700 (PDT) From: miztaken To: java-user@lucene.apache.org Subject: Strange Error while deleting Documents from index while indexing. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: manish@ccnep.com.np X-Virus-Checked: Checked by ClamAV on apache.org 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: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org