在 SOLR 中,为什么一个字段是非存储和非索引的?

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

在 Solr 关于原子更新的文档中,他们提到字段应该是非索引和非存储的。

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

这样做的示例用例是什么?

这是否意味着它不可查询且不在响应中返回?

在这种情况下要理解的是,设置 "docValues=true" 旨在作为 "index=true" 的替代方案:仍​​然使字段 "queryable" 但在面向列的 (non-inverted) 指数.

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

实际上能够在 sort/facet-dedicated-field 中进行原子更新是 一个例子 use-case !

请记住,即使设置为 "stored=false",仍然可以获取启用了 docValues 的字段,例如允许使用 fl 参数检索值。这是因为 docValues 以 "always" 的方式存储,如何取决于默认为 "Memory" 的 docValuesFormat (意味着 doc 值 存储 在堆中) .

DocValues 字段还依赖于默认为 true 的 useDocValuesAsStored,这意味着即使定义为 stored="false".

,该字段的行为就好像它被定义为 stored="true" 一样