ElasticSearch Modified Analyzer无法正常工作[停用词]

时间:2013-09-24 23:48:50

标签: elasticsearch stop-words

我将以下内容添加到我的elasticsearch.yml

# Index Settings
index:
  analysis:
    analyzer:
      # set standard analyzer with no stop words as the default for both indexing and searching
      default:
        type: standard
        stopwords: _none_

现在我做了以下事情:

curl -XGET 'localhost:9200/_analyze?analyzer=default' -d 'this is a test'

仍然有:

{
  "tokens": [
    {
      "token": "test",
      "start_offset": 10,
      "end_offset": 14,
      "type": "<ALPHANUM>",
      "position": 4
    }
  ]
}

我希望所有的话都在那里!并非我通过以下方式运行elasticsearch:

sudo /usr/local/elasticsearch/elasticsearch-0.90.0/bin/service/elasticsearch64 restart

1 个答案:

答案 0 :(得分:0)

请尝试使用此设置(而不是 none ,在停用词部分中使用空字符串)

# Index Settings
index:
  analysis:
    analyzer:
      # set standard analyzer with no stop words as the default for both indexing and searching
      default:
        type: custom
        tokenizer: standard
        filter: [standard,lowercase]

请注意,进行此更改后,您需要重新启动elasticsearch服务。