Home:ALL Converter>Solr sorting function fails with colon in field name

Solr sorting function fails with colon in field name

Ask Time:2013-07-07T23:49:29         Author:Alex

Json Formatter

I have a very strange problem with Solr sorting function. When I do a simple sort by field value, it works fine. Here the query that works:

q=ss_type:product_variant
sort=fs_field_master_product:field_price asc

However, when I do a sort by a sum of values it gives an error. The query: q - the same

sort=sub(fs_field_master_product:field_price,10) asc

The error:

<lst name="error">
  <str name="msg">can not sort on a field which is neither indexed nor has doc values: sub(fs_field_master_product:field_price,10)</str>
  <int name="code">400</int>
</lst>

I couldn't find much about this kind of issues with sorting functions on Internet, any help is highly welcome!

ps. I was inclined to consider the colon in field's name to be the root of the problem, but Solr didn't fail in any other cases the field is used.

Author:Alex,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/17513647/solr-sorting-function-fails-with-colon-in-field-name
yy