multi_field ActiveModel mappings not working #613
Comments
You have to use the Admittedly, the |
So, I changed the workflow from:
to
and now ES is picking up the mappings. Thanks! |
Great. Also, please put the information as an answer to your question here: http://stackoverflow.com/questions/14690975/why-multi-field-mapping-is-not-working-with-tire-gem-for-elasticsearch, and accept it, so it's not unanswered. By the way, I greatly appreciate when people create either Github issue or Stackoverflow question, not both .) |
Ok. Will do. |
Wow this wasted quite a bit of my time. Could you put a deprecation warning on the other method or fix it? |
@davidguthu What has? That |
I just bumped into this problem as well. Good that I remembered I've seen it before, here (while looking for other things, obviously). Maybe it would be a good idea of putting it in the documentation / examples, somewhere. Thanks for the provided support, overall! |
I'm using elastic search to enhance search capabilities in my app. Search is working perfectly, however sorting is not for fields with multiple words.
When I try to sort the search by log 'message', I was getting the error:
"Can't sort on string types with more than one value per doc, or more than one token per field"
I googled the error and find out that I can use multi-fields mapping on the :message field (one analyzed and the other one not) to sort them. So I did this:
But, for some reason is not passing this mapping to ES.
rails console:
So,
Log.index.mapping
is the current mapping in ES which doesn't contain the multi-field that I created. Am I missing something? and why the multi-field is shown inLog.mapping
but not inLog.index.mapping
?The text was updated successfully, but these errors were encountered: