User usually like to Solr of Fields such as Document title and do not get the expected results.
Few key things to take into account when using fields for Sorting in Solr -
- Sorting doesn't work good on multivalued and tokenized fields. (multivalued="false")
- The field should be marked as indexed to enable sorting. (indexed="true")
Documentation -
Sorting can be done on the "score" of the document, or on any multiValued="false" indexed="true" field provided that field is either non-tokenized (ie: has no Analyzer) or uses an Analyzer that only produces a single Term (ie: uses the KeywordTokenizer)
<field name="title" type="text" indexed="true" stored="true"/>
<field name="title_sort" type="string" indexed="true" stored="false"/>
<!-- Copy to a string type field -->
<copyField source="title" dest="title_sort" />
No comments:
Post a Comment