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.