you should check the return count from deleteDocuments ... if i had to
guess i would say that your analyzer is steming the input in such a way
that your indexed terms don't match the Term you are trying to delete on.


: Date: Fri, 23 Feb 2007 16:48:27 -0000
: From: "Kainth, Sachin" <[EMAIL PROTECTED]>
: Reply-To: java-user@lucene.apache.org
: To: java-user@lucene.apache.org
: Subject: Index modification
:
: 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.
:



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to