Вопрос

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!

Это было полезно?

Решение

You should also change the index mapping settings.

Indices are automatically analyzed by default_analyzer which is of course deletes English stopwords. Example mapping with two type of information content and time

"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"
        }
      }
    }
  }
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top