I use and play with Lucene to index our data, and I came across some weird behavior regarding DocValues fields.
So, can anyone just explain the difference between a regular document field (e.g. StringField , TextField , IntField , etc.) and DocValues fields (e.g. IntDocValuesField , SortedDocValuesField (types seem to have changes in Lucene 5.0) and t .d.)?
First, why can't I access DocValues using document.get (file_name) ? if so, how can I access them?
Secondly, I saw that in Lucene 5.0 some functions are changed, for example, sorting can be performed only on DocValues ... why?
Thirdly, DocValues can be updated, but regular fields cannot (you need to delete and add the whole document) ...
Also, and perhaps most importantly, when should DocValues and regular fields be used?
Joseph
lucene solr
Yossi vainshtein
source share