Wednesday, October 20, 2021

Sitecore sorting best practices and recommendation.

Sometimes applying a simple sorting based on title can create an issue, we need to be very careful about it.

Applying sorting based on title is not going to work, strange right?

Let's see this in detail.

The title is a text general field and the tokenizer will make tokens of the value so logically you can't do sorting on this field


In case if we want to do the sorting on the title field, It's recommended to create a copy field which will basically copy the data from the title and move into the target field and make sure that the target field is a string field so it will hold the string value and sorting can be done.

Example for the text or text general field 




With string field



Solution - How to add a copy field  - Reference - https://solr.apache.org/guide/6_6/copying-fields.html


<copyField source="cat" dest="text" maxChars="30000" />


Hope this will help to others.

No comments:

Post a Comment