首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Elasticsearch外语停止词

Elasticsearch外语停止词
EN

Stack Overflow用户
提问于 2013-07-28 16:57:04
回答 1查看 942关注 0票数 1

我是Elasticsearch的新手,我正在尝试使用一些测试,但是在使用(本例中)法语分析器和停止单词时,我遇到了一个问题。这是我建立的索引:

代码语言:javascript
复制
test1: {

    state: open
    settings: {
        index.analysis.analyzer.french.tokenizer: standard
        index.analysis.filter.stop_fr.stopwords.0: _french_
        index.analysis.filter.stop_fr.type: stop
        index.analysis.analyzer.french.filter.1: stop_fr
        index.analysis.analyzer.french.filter.0: lowercase
        index.analysis.analyzer.french.type: custom
        index.number_of_shards: 5
        index.number_of_replicas: 1
        index.version.created: 900299
    }

然而,当我从ES头运行“测试分析器”工具时,法语停止词仍在传递,而英语停止词(the、a等)仍然存在。不是的。任何洞察力都会很感激的。谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-07-29 06:44:59

还应更改索引映射设置。

索引由default_analyzer自动分析,当然是删除英语停止词。使用两种信息contenttime的示例映射

代码语言:javascript
复制
"testindex": {
    "testtype": {
      "search_analyzer": "test_analyzer", // <-- search_analyzer
      "properties": {
        "content": {
          "type": "string",
          "store": true,
          "analyzer": "test_analyzer"  // <-- index_analyzer
        },
        "time": {
          "type": "date",
          "store": true,
          "format": "dateOptionalTime"
        }
      }
    }
  }
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17910563

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档