11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

done in schema.xml.<br />

Enabling a field for docValues only requires adding docValues="true" to the field (or field type) definition, as<br />

in this example from the schema.xml of <strong>Solr</strong>'s sample_techproducts_configs config set:<br />

<br />

If you have already indexed data into your <strong>Solr</strong> index, you will need to completely re-index your content<br />

after changing your field definitions in schema.xml in order to successfully use docValues.<br />

DocValues are only available for specific field types. The types chosen determine the underlying Lucene<br />

docValue type that will be used. The available <strong>Solr</strong> field types are:<br />

1.<br />

2.<br />

StrField and UUIDField.<br />

If the field is single-valued (i.e., multi-valued is false), Lucene will use the SORTED type.<br />

If the field is multi-valued, Lucene will use the SORTED_SET type.<br />

Any Trie* numeric fields and EnumField.<br />

If the field is single-valued (i.e., multi-valued is false), Lucene will use the NUMERIC type.<br />

If the field is multi-valued, Lucene will use the SORTED_SET type.<br />

These Lucene types are related to how the values are sorted and stored.<br />

There are two implications of multi-valued DocValues being stored as SORTED_SET types that should be kept<br />

in mind when combined with /export (and, by extension Streaming Aggregation-based funcitonality):<br />

Values are returned in sorted order rather than the original input order.<br />

If multiple, identical entries are in the field in a single document, only one will be returned for that<br />

document.<br />

There is an additional configuration option available, which is to modify the docValuesFormat used by the field<br />

type. The default implementation employs a mixture of loading some things into memory and keeping some on<br />

disk. In some cases, however, you may choose to specify an alternative DocValuesFormat implementation. For<br />

example, you could choose to keep everything in memory by specifying docValuesFormat="Memory" on a<br />

field type:<br />

<br />

Please note that the docValuesFormat option may change in future releases.<br />

Lucene index back-compatibility is only supported for the default codec. If you choose to customize the d<br />

ocValuesFormat in your schema.xml, upgrading to a future version of <strong>Solr</strong> may require you to either<br />

switch back to the default codec and optimize your index to rewrite it into the default codec before<br />

upgrading, or re-build your entire index from scratch after upgrading.<br />

Using DocValues<br />

Sorting, Faceting & Functions<br />

If docValues="true" for a field, then DocValues will automatically be used any time the field is used for sortin<br />

g, faceting or Function Queries.<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

96

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!