2
votes

I am planning to try Solr's docValues to hopefully improve facet and sort performance. I have some questions around this feature:

  1. If I enable docValues, will Solr create a forward index (for faceting) in addition to a separate reverse index (for searching)? Or will Solr simply create a forward index ONLY? (thus, resulting to performance gain in faceting in exchange for performance loss in searching)
  2. If I want to both facet and search in a single field, what is the best practice? Should I set "indexed=true" and "docValues=true" in the same field or should I create a copy field where the source field has indexed=true while the destination field has docValues=true? (i.e. optimize the source field for search while the dest field for faceting; is this even needed?)
  3. The following documentation page from Datastax states: "for faceting to use docValues, the schema needs to specify multiValued="true" even if the field is a single-value facet field". I'm a bit confused - is this only true for copy fields (dest) that are to be used with docvalues or is this true even for non-copy fields?

I am using Datastax Enterprise 4.5.2

1
From: cwiki.apache.org/confluence/display/solr/DocValues I don't think you need a copy field. The straight fwd interpretation of the doc is that setting indexed=true will create inverted index and docValues=true will create the forward index. Setting multiValued=true won't hurt if the field is single valued. So just try it out and see.arun

1 Answers

1
votes

Solr faceting implementation will make use of DocValues only if they're marked as multivalued, so unless your field is actually multivalued, I'd suggest to use a non-stored copy field with multiValued=true and docValues=true, to avoid storing your single-value field as a Cassandra list/set.