Set update_all_types to true on ElasticSearch

匿名 (未验证) 提交于 2019-12-03 08:36:05

问题:

I want to add some additional properties to my mappings, in this specific case I want to modify a title field in my English index so that it would use the english analyzer.

Should be pretty straightforward, except that I have a title field in quite some types, and it seems to be not possible to do this.

The error I have is the following : Set update_all_types to true to update [search_quote_analyzer] across all types.]

But I am not able to find a single reference on how or where to set this 'update_all_types' parameter.

This is the very simple code I use in Sense :

PUT /my_index/_mapping/my_type     {       "properties": {         "title": {           "type": "string",           "analyzer": "english"         }       }     } 

So, how can I make this work if the same field is used in other types ?

This is the error message :

"type": "illegal_argument_exception", "reason": "Mapper for [title] conflicts with existing mapping in other types:   [mapper [title] has different [analyzer], mapper [title] is used by   multiple types. Set update_all_types to true to update [search_analyzer]   across all types., mapper [title] is used by multiple types. Set   update_all_types to true to update [search_quote_analyzer] across   all types.]" 

So it seems I need to set 'update_all_types:true' somewhere, but the documentation fails on that part.

回答1:

You can find the documentation here !

The update_all_types is a get parameter to give like that : PUT my_index/_mapping/type_one?update_all_types



回答2:

I had a similar issue, try the code below to update all types:

   PUT /my_index/_mapping/my_type?update_all_types     {       "properties": {         "title": {           "type": "string",           "analyzer": "english"         }       }     } 


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