Jay Taylor's notes
back to listing indexruby on rails - Tire Gem Returns 'Can't sort on string types with more than one value per doc, or more than one token per field' - Stack Overflow
[web search]
I have mapped an associated field as a multi-field. I have set the 'name' property to be analyzed using a snow ball analyzer and 'exact' as not analyzed. I am able to search on this field and filter as well. I am not able to sort on this field. When trying to sort, elastic returns an error "Can't sort on string types with more than one value per doc, or more than one token per field". I have attempted creating an additional field called 'raw' similar to exact, and this did not work either. Below is my mapping and how I am attempting to perform the sort via the tire gem:
| |||
add comment | |||
There are basically two reasons why you're getting that error:
I would check what your documents look like. In order to do it quickly you can make a Terms Facet based on a script which returns the number of items included in the
| |||||||||||||||||||||||||||||||||
|
IMHO, it should work. Just wondering if your mapping is applied. Can you check it with a curl command? Something like: $ curl -XGET 'http://localhost:9200/twitter/tweet/_mapping' | |||||||||
|