Skip to content

Instantly share code, notes, and snippets.

View rhamlin's full-sized avatar

Richard Hamlin rhamlin

  • Software Development
  • Boerne, Tx
View GitHub Profile

Implementing Solr DocValues:

In SOLR, optimize your indexing loads and memory utilization by implementing DocValues.

When storing fields, your fields are stored and indexed separately. When using DocValues, DocValues are much more compact than the stored fields and the term indexes (this can also evidenced by examing the index and stored fields file-sizes). Since DocValues for a single field are stored contiguously, very efficient packing algorithms are used thereby compressing the file more efficiently instead of being sparsely stored like they are when only using stored fields.

Since DocValues are column-oriented fields, meaning the values of DocValue fields are densely packed into columns instead of sparsely stored like they are with stored fields.

Simple example of stored fields vs docValues:

row-oriented (stored fields):