Search code examples
lucenesolr4solr-schema

Solr Retrieve values of not stored field


How can I get field "to" values which is specified as not stored in solr schema. This field have a copyField "text ". Facet causes memory out of bound, Is there any way to see the values without the use of facet query?


Solution

  • you can not retrieve values of a field if the < stored="false"> is set.

    There are usually two parameters indexed and stored which can have different combination.

    < indexed="true" stored="true">

    In this case the values are both stored and indexed. that is you can search on that field and also can retrieve it if needed in the search results.

    < indexed="true" stored="false">

    In this case the value of the field is indexed i.e searchable but not stored, hence can not be retrieved.

    < indexed="false" stored="true">

    In this case the value is not searchable , you can however return it in the search results.

    < indexed="false" stored="false">

    In this case you can neither store nor can search the field.

    The reason behind the stored attribute is that that Solr or rather lucene "analyzes" or transforms the input data into a more efficient form for faster and more relevant search(using different analyzers and tokenizers). Unfortunately, that analyzed/transformed data is frequently no longer suitable for display. Setting "stored=true" guarantees that the original data can be retrieved in its original form.