1

I'm new to Elasticsearch and am trying to spin up with some testing, however I'm running into an issue when it comes to using (for this case) a French analyzer and stop words. This is the index I have set up:

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
    }

However, when I run the 'Test Analyser' tool from ES Head, the French stop words are still getting through while English stop words (the, a, etc..) aren't. Any insight would be greatly appreciated. Thanks!

4

1 回答 1

1

您还应该更改索引映射设置。

默认分析器会自动分析索引,这当然会删除英语停用词。具有两种类型信息的示例映射contenttime

"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"
        }
      }
    }
  }
于 2013-07-29T06:44:59.767 回答