Solr index vs stored

前端 未结 5 722
执笔经年
执笔经年 2020-11-29 00:53

I am a little confused as to what the behaviour of the index and stored attibutes of the Solr fields is.

For example if I have the following in the Schema.xml

5条回答
  •  粉色の甜心
    2020-11-29 00:59

    Quoting from this response in the Solr's mail thread:

    "indexed" and "stored" are independent, orthogonal attributes - you can use any of the four combinations of true and false. "indexed" is used for search or query, the "lookup" portion of processing a query request. Once the search/query/lookup is complete and a set of documents is selected, "stored" is the set of fields whose values are available for display or return with the Solr response.

    Part of the reason for the separation is that Solr/Lucene "analyzes" or transforms the input data into a more efficient form for faster and more relevant search/lookup. Unfortunately, that analyzed/transformed data is frequently no longer suitable for display and human consumption. In other words the analysis/transformation is not bidirectional/reversible. Setting "stored=true" guarantees that the original data can be retrieved in its original form.

提交回复
热议问题