我将以下内容添加到我的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
答案 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服务。