I am planning to try Solr's docValues to hopefully improve facet and sort performance. I have some questions around this feature:
- 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)
- 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?)
- 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
indexed=true
will create inverted index anddocValues=true
will create the forward index. SettingmultiValued=true
won't hurt if the field is single valued. So just try it out and see. – arun