You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by wgggfiy <wu...@qq.com> on 2012/11/17 17:08:02 UTC

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-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: how do re-get the doc after the doc was indexed ?

Posted by wgggfiy <wu...@qq.com>.
Wa, Exactly !!
thx, jack. good idea



--
View this message in context: http://lucene.472066.n3.nabble.com/how-do-re-get-the-doc-after-the-doc-was-indexed-tp4020865p4020868.html
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


Re: how do re-get the doc after the doc was indexed ?

Posted by Jack Krupansky <ja...@basetechnology.com>.
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-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org 


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