Gravatar for sohelsd@gmail.com

Question by sohel, Nov 11, 2015 1:06 PM

Field Sorting Issue

Field Sort Component was working fine until I tried to update the datasource and rebuild the index. Basically I have a Sitecore template field Price that I mapped in Coveo.SearchProvider.config (fieldType fieldName='Model Price' isFacet="false" isSortable="true" includeForFreeTextSearch="false" isMultiValue="false" settingType='Coveo.Framework.Configuration.FieldConfiguration, Coveo.Framework') and specified a Custom Field Sort in Sort Field Component on UI.

I tried deleting the indexes and security and rebuild everything from scratch. Unfortunately the Price sort is not accurate any more.

You can see here http://www.waspbarcode.com/search Try to sort by Price and notice the issue.

Anything else I can check to troubleshoot this?

1 Reply
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Nov 11, 2015 7:38 PM

Hi,

Your "Model Price" field is indexed as a string. I found that by looking at the JSON returned by the REST endpoint. Thus, the values are sorted alphabetically and not numerically.

I don't know if your "Model Price" field is a Sitecore template field or a computed field but you should check it's type and convert it to a floating point number type.

Gravatar for sohelsd@gmail.com

Comment by sohel, Nov 11, 2015 7:59 PM

Yes, that is correct as in it is a string and is a sitecore template field. So the only way to fix this is to convert it into computed field? I wonder why it worked until this datasource change.

Ask a question