lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "308181687" <308181...@qq.com>
Subject Re:Best practice to map Lucene docids to real ids
Date Tue, 06 May 2014 09:04:47 GMT
Why not add an LongField to store the real id, and retrieve it directly  by Document.get('real
id field name').


  lubin
------------------ Original ------------------
From:  "Sven Teichmann";<s.teichmann@s4ip.de>;
Date:  Tue, May 6, 2014 04:33 PM
To:  "java-user"<java-user@lucene.apache.org>; 

Subject:  Best practice to map Lucene docids to real ids



Hi,

what is the best way to retrieve our "real" ids (as they are in our 
database) while searching?

Right now we generate a file after indexing which contains all Lucene 
docids and the matching id in our database. Our own Collector converts 
the docids to our ids while collecting. This works as long as no 
document is deleted and the index optimized after it.

Is this a good solution or should we use Fields or DocValues for this? 
What is the fastest solution?

Regards,

Sven Teichmann


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

.
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message