Sounds like you want path to be a unique key field. So, just do a Lucene search with a TermQuery for the path, which should return one document. No need to mess with Lucene internal doc ids.

-- Jack Krupansky

-----Original Message----- From: wgggfiy
Sent: Saturday, November 17, 2012 8:08 AM
To: java-user@lucene.apache.org
Subject: how do re-get the doc after the doc was indexed ?

for example:
I indexed a doc with path=c:/books/appach.txt, author=Mike
After a long time, I wanted to modify the author to John.
But the quethion is how I can get the exact same doc fastly ??
My idea is to traverse the docs from id=0 to id=maxDoc(), and
retrive it with store fields, and check its path whether equals
path=c:/books/appach.txt.
Any better idea ??
thx




--
View this message in context: http://lucene.472066.n3.nabble.com/how-do-re-get-the-doc-after-the-doc-was-indexed-tp4020865.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to