简体   繁体   English

Elasticsearch ICU插件-找不到分析器

[英]Elasticsearch ICU plugin - Analyzer not found

I'm trying to use the ICU Plugin on an embedded instance of Elasticsearch. 我正在尝试在Elasticsearch的嵌入式实例上使用ICU插件。 I have installed it by adding the dependency to the pom, and set up the settings for the plugin, which seems to be correctly loaded: 我已经通过将依赖项添加到pom中进行了安装,并设置了似乎正确加载的插件设置:

INFO  -  [Quasar] loaded [analysis-icu], sites []

The settings are the following: 设置如下:

"index-name": {
    "settings": {
        "analysis": {
            "analyzer": {
                "ducet_sort": {
                    "tokenizer": "keyword",
                    "filter": [ "icu_collation" ]
                }
            }
        }
    }

The bit of the mapping where I'm trying to use the plugin at looks like this: 我尝试在其中使用插件的映射有点像这样:

"primaryName": {
    "type": "string",
        "fields": {
            "sort": {
                "type": "string",
                "analyzer": "ducet_sort"
            }
        }
},

When I try to PUT the mapping file into the index, I get the following exception: 当我尝试PUT映射文件到索引中,我得到以下异常:

org.elasticsearch.index.mapper.MapperParsingException: Analyzer [ducet_sort] not found for field [sort]

Does anybody know what's happening here? 有人知道这里发生了什么吗? I did some previous investigation on this and it worked on a standalone instance installed on my machine... 我对此进行了一些先前的调查,发现它可以在我的计算机上安装的独立实例上工作。

Thanks! 谢谢!

EDIT: I'm using ES version 1.3.1 and ICU plugin version 2.3.0 编辑:我正在使用ES版本1.3.1和ICU插件版本2.3.0

Okay... After a couple of hours I found the issue. 好吧...几个小时后,我发现了问题。 The configuration was not right and ES was not picking up the analyzer correctly. 配置不正确,ES无法正确接收分析仪。 This did it: 做到了:

{
    "index": {
        "analysis": {
            "analyzer": {
                "ducet_sort": {
                    "tokenizer": "keyword",
                    "filter": [ "icu_collation" ]
                }
            }
        }
    }
}

The settings bit was unnecessary. settings位是不必要的。 I'm not exactly sure why this was happening, but it's nowhere in the docs. 我不确定为什么会这样,但是在文档中却没有。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM