FAQ
Hi Danny,

I have explained it above.

It has many fields out of which DocId is the field which I am storing as
well as indexing. While other fields I am just storing.
And Each document has unique DocId.

d=new Document();
File indexDir = new File("./index-dir");
StandardAnalyzer analyzer = new StandardAnalyzer(Version.LUCENE_31);
IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_31, analyzer);
try {
writer = new IndexWriter(FSDirectory.open(indexDir),conf);
} catch (IOException e1) {
e1.printStackTrace();
}
String q1 = contract.getDocId(); // Here I am getting my DocId
Term term = new Term("DocID",contract.getDocId());


Rest I have stated above.


On Fri, Jun 10, 2011 at 4:44 PM, Danny Lade wrote:

You delete it first using your id:
writer.deleteDocuments(term);
and then re-add it with the same id:

writer.addDocument(d);
Please explain:
How looks your document BEFORE you try to delete it? (Which fields has it?)

Greetings Danny


--
I'm very responsible, when ever something goes wrong they always say I'm
responsible --

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 8 | next ›
Discussion Overview
groupjava-user @
categorieslucene
postedJun 10, '11 at 8:25a
activeJun 10, '11 at 12:37p
posts8
users4
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase