lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wouter Heijke" <>
Subject Re: Best practice to map Lucene docids to real ids
Date Wed, 07 May 2014 14:09:21 GMT
Hey Mike,

That was a very useful response, also for long time Lucene users like
myself who were stuck in legacy ways of doing things!
I managed to easily change indexing of keys to DocValues and found myself
wondering why I did not get anything returned, it appears indexing works
transparent to any field, but to get your DocValue key out of the 'index'
you need to use the AtomicReader... all now works like it did before, only
faster (i hope ;-))


> Doc values is far faster than a stored field.
> If the default DocValuesFormat isn't fast enough, you can always
> switch to e.g. DirectDocValuesFormat (uses lots of RAM but it just an
> array lookup).
> Mike McCandless
> On Tue, May 6, 2014 at 4:33 AM, Sven Teichmann <>
> wrote:
>> 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:
For additional commands, e-mail:

View raw message