Thank you Erick and Shawn.
1) So it seems like docValues should always be preferred over stored fields for retreival if sorting-of-multivalued-fields is not a concern. Is that a correct understanding? 2) Also, the in-place atomic updates (with docValues=true and stored/indexed=false) should be much faster than regular atomic updates (with docValues=anything and stored/indexed=true). This is so because in-place updates are just looking up the document corresponding to the field in the columnar-oriented lookup and changing the value there. The document itself is not re-indexed because stored is false and indexed is false for an in-place update. If there is any bench-mark to verify this, it would be great. 3) If the performance is dreadful to search with docValue=true, indexed=false fields, then why is that even allowed? Shouldn't Solr just give an error for such cases? Thanks SG On Fri, Nov 17, 2017 at 6:50 AM, Erick Erickson <erickerick...@gmail.com> wrote: > I'll add that using docValues in place of stored is much more > efficient than using stored. To access stored=true data > 1> a 16K block must be read from disk > 2> the 16K block must be decompressed. > > With docValues, the value is a simple lookup, the value is probably in > memory already (MMapped) and the decompression of a large block is > unnecessary. > > There is one caveat: docValues uses (for multiValued fields) a > SORTED_SET. Therefore multiple identical values are collapsed and the > values are sorted. So if your input was > 5, 6, 3, 4, 3, 3, 3 > the retrieved values would be > 3, 4, 5, 6 > > If this is NOT ok for your app, then you should use stored values to > retrieve. Otherwise DocValues is preferred. > > Best, > Erick > > On Fri, Nov 17, 2017 at 5:44 AM, Shawn Heisey <apa...@elyograg.org> wrote: > > On 11/17/2017 12:53 AM, S G wrote: > >> > >> Going through > >> > >> https://www.elastic.co/guide/en/elasticsearch/guide/ > current/_deep_dive_on_doc_values.html > >> , > >> is it possible to enable only docValues and disable stored/indexed > >> attributes for a field? > > > > > > Yes, this is possible. In fact, if you want to do in-place Atomic > updates, > > this is how the field must be set up. > > > > https://lucene.apache.org/solr/guide/6_6/updating-parts- > of-documents.html#UpdatingPartsofDocuments-In-PlaceUpdates > > > >> In that case, the field will become only sortable/facetable/pivotable > but > >> it cannot be searched nor can it be retrieved? > > > > > > Recent Solr versions can use docValues instead of stored when retrieving > > data for results. This can be turned on/off on a per-field basis. The > > default setting is enabled if you're using a current schema version. > > > > https://lucene.apache.org/solr/guide/6_6/docvalues.html#DocValues- > RetrievingDocValuesDuringSearch > > > > As I understand it, you actually *can* search docValues-only fields > (which > > would require a match to the entire field -- no text analysis), but > because > > it works similarly to a full-table scan in a database, the performance is > > dreadful on most fields, and it's NOT recommended. > > > > Thanks, > > Shawn >