0

I am having a solr Field as -

<dynamicField name="storeSKUColor_*" type="string" multiValued="true" indexed="false" stored="true" />

Issue is this field takes too much time while fetching data using solrJ.

I thought of making this field as - stored="false" docValues="true".

Solr did not throw any error and data is indexed properly.

Usability of this field -

  1. There is not sorting/faceting on this field.
  2. Only display value is being used.

I want to make data fetching faster using solrJ. I am not able to find any proper documentation on whether stored=true or multivalued=true help in performance.

I know that solrJ uses lazy loading for fields that are stored=true.

Can anybody please guide regarding this.

1 Answers1

0

multiValued isn't about performance, it's about allowing one field to have multiple values in a single document. If you don't need to do anything else than store the field - and ALL the fields returned is compatible with docValues="true" - use docValues:

In cases where the query is returning only docValues fields performance may improve since returning stored fields requires disk reads and decompression whereas returning docValues fields in the fl list only requires memory access.

If not, use docValues="false" indexed="false" stored="true" for the field, as this should be the quickest way to retrieve the field's value (but you can benchmark it for your use case).

Note that returning DocValues along with "regular" stored fields at query time has performance implications that stored fields may not because DocValues are column-oriented and may therefore incur additional cost to retrieve for each returned document.

Avoid retrieving fields you're not using - you can do this with solrQuery.setParam('fl', '...').

MatsLindh
  • 49,529
  • 4
  • 53
  • 84