You need to index the UUID as a standard indexed StringField. Then you can do a 
lookup using TermQuery. That's how all systems like Solr or Elasticsearch 
handle document identifiers.

DocValues are for facetting and sorting, but looking up by ID is a typical use 
case for an inverted index. If you still need to store it as DocValues field, 
just add it with both types.

Uwe

-----
Uwe Schindler
Achterdiek 19, D-28357 Bremen
https://www.thetaphi.de
eMail: u...@thetaphi.de

> -----Original Message-----
> From: Alex K <aklib...@gmail.com>
> Sent: Monday, July 5, 2021 2:30 AM
> To: java-user@lucene.apache.org
> Subject: Does Lucene have anything like a covering index as an alternative to
> DocValues?
> 
> Hi all,
> 
> I am curious if there is anything in Lucene that resembles a covering index
> (from the relational database world) as an alternative to DocValues for
> commonly-accessed values?
> 
> Consider the following use-case: I'm indexing docs in a Lucene index. Each
> doc has some terms, which are not stored. Each doc also has a UUID
> corresponding to some other system, which is stored using DocValues. When I
> run a query, I get back the TopDocs and use the doc ID to fetch the UUID
> from DocValues. I know that I will *always* need to go fetch this UUID. Is
> there any way to have the UUID stored in the actual index, rather than
> using DocValues?
> 
> Thanks in advance for any tips
> 
> Alex Klibisz


---------------------------------------------------------------------
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