Elastic Search/Tire: How to map to association attribute?

别说谁变了你拦得住时间么 提交于 2019-12-04 11:25:37

When you do

 query   { string params[:query] } 

and the query doesn't specify a field, you're searching the magic _all field. This field has its own analyzer settings - it's won't be using the one you've setup for your name field.

You can either configure the _all field to use your analyser, change the default analyser or change your query to query the name field specifically, for example

 query { string params[:query], :default_field => 'name'}

This was to much of a headache so I ended going to Ransack which was insanely much easier to figure out and use.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!