0

我将以下内容添加到我的 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
    }
  ]
}

我希望所有的词都在里面!并不是说我通过以下方式运行弹性搜索:

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

1 回答 1

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 服务。

于 2013-09-25T06:28:37.787 回答