Solr wrong sort text fields

亡梦爱人 提交于 2019-12-01 16:27:14
Jayendra

Sorting doesn't work good on multivalued and tokenized fields.
As testata has been defined with text_general field type, it will be tokensized and hence the sort would not work fine.

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)

Source: http://wiki.apache.org/solr/CommonQueryParameters#sort

Use string as the field type and copy the title field into the new field.

<field name="testata_sort" type="string" indexed="true" stored="false"/>

<copyField source="testata" dest="testata_sort" />  
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!