本文介绍了ElasticSearch 5:MapperParserException with multi_field的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此映射与ES 2.X一起使用,现在使用ES 5,我收到一个例外:

This mapping hast worked with ES 2.X, now with ES 5 I get an exception:

{  
"type1":{  
    "properties":{  
        "name":{  
            "type":"multi_field",
            "fields":{  
                "name":{  
                    "type":"string",
                    "index_analyzer":"standard",
                    "index":"analyzed",
                    "store":"no",
                    "search_analyzer":"standard"
                },
                "name_autocomplete":{  
                    "type":"string",
                    "index_analyzer":"autocomplete",
                    "index":"analyzed",
                    "store":"no",
                    "search_analyzer":"standard"
                }
            }
        }
    }
}

}

例外情况是:

没有t的处理程序ype [multi_field]在字段[name]上声明

No handler for type [multi_field] declared on field [name]

有人有个想法?谢谢! ;)

Someone an idea? Thanks! ;)

推荐答案

多字段已在ES 1.x中弃用并在ES 5.x中完全删除。

multi-field was deprecated in ES 1.x and completely removed in ES 5.x.

现在,通过使用,您可以这样指定:

Now multi fields are supported via the use of fields which you can specify like this:

{  
  "type1":{  
    "properties":{  
        "name":{  
            "type":"text",
            "analyzer":"standard",
            "index":"analyzed",
            "store":"no",
            "search_analyzer":"standard"
            "fields": {
                "autocomplete":{  
                    "type":"text",
                    "analyzer":"autocomplete",
                    "index":"analyzed",
                    "store":"no",
                    "search_analyzer":"standard"
                }
            }
        }
    }
  }
}

这篇关于ElasticSearch 5:MapperParserException with multi_field的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 08:05