Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Luke Where are my field values?

Tags:

lucene

luke

I've used Luke like four times per year for the past three years. I only break it out when I need it. One concept I've never understood is why only certain fields' values are displayed. I can query these "empty" fields for expected values and get the expected results, but Luke never displays these. I assume I'm missing something fundamental and obvious, but it's not so obvious to me.

Example Search tab:

enter image description here

Example Documents tab:

enter image description here

like image 847
Dzejms Avatar asked Nov 02 '22 15:11

Dzejms


1 Answers

When a program creates a Lucene Document, it might tell Lucene whether to store the value of the field or not. See, for example, the stored argument to the StringField constructor. If the value is not stored then it can be searched on, but the original bytes of the value are not saved in the index, since they are not required nor used by the search.

A typical pattern with, say, http://www.elasticsearch.org/ is to store the original JSON in a single field and not to store the actually indexed fields. That way the application working with the retrieved data might use it's native data format and does not have to be aware of the Lucene and it's flat key-value Document.

like image 55
ArtemGr Avatar answered Nov 11 '22 12:11

ArtemGr