lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kainth, Sachin" <Sachin.Kai...@atkinsglobal.com>
Subject Index modification
Date Fri, 23 Feb 2007 16:48:27 GMT
Hi all,

I am using the IndexModifier class to perform index modification.  I
have deleted 1 document from an index and the output indicates that 1
document does indeed get deleted.  However, running the program again
reveals that the document deleted has appeared again in the index.  This
despite the fact that I close the IndexModifier after the deletion.
Does anyone know what I'm missing?  Here is my code:

       	Analyzer analyzer = new PorterAnalyzer();
            IndexModifier indexModifier = new IndexModifier("D:\\Index",
analyzer, false);
            Console.WriteLine(indexModifier.DocCount() + " docs in
index");
            //indexModifier.Delete(1);
            indexModifier.Delete(new Term("artist", "hot"));
            Console.WriteLine("Deleted a document");
            Console.WriteLine(indexModifier.DocCount() + " docs in
index");
            indexModifier.Close();

Cheers




This email and any attached files are confidential and copyright protected. If you are not
the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise
expressly agreed in writing, nothing stated in this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No.
1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.

Consider the environment. Please don't print this e-mail unless you really need to. 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message