In SOLR why would a field be non-stored and non-indexed?

帅比萌擦擦* 提交于 2020-11-28 09:10:30

问题


In Solr's documentation around atomic updates, they mention that a field should be non-indexed and non-stored.

https://lucene.apache.org/solr/guide/7_6/updating-parts-of-documents.html#in-place-update-example

An atomic update operation is performed using this approach only when the fields to be updated meet these three conditions:

are non-indexed (indexed="false"), non-stored (stored="false"), single valued (multiValued="false") numeric docValues (docValues="true") fields;

<field name="price" type="float" indexed="false" stored="false" docValues="true"/>

What would be an example use-case of doing this?

Wouldn't that mean that it's not queryable and not returned in responses?


回答1:


The thing to understand in this context is that setting "docValues=true" is intended as an alternative to "index=true": still making the field "queryable" but in a column oriented (non-inverted) index.

[...] a way of recording field values internally that is more efficient for some purposes, such as sorting and faceting, than traditional indexing.

Actually being able to make atomic updates in a sort/facet-dedicated-field is an example use-case !

Remember that a field with docValues enabled can still be fetched even if set as "stored=false", allowing for example to retrieve values using the fl parameter. That is because docValues are in a way "always" stored, how depends on docValuesFormat that defaults to "Memory" (meaning doc values are stored in heap).

DocValues fields also relies on useDocValuesAsStored that defaults to true, meaning the field behaves as if it were defined as stored="true" even if defined as stored="false".



来源:https://stackoverflow.com/questions/56276942/in-solr-why-would-a-field-be-non-stored-and-non-indexed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!