我构建以下内容:
curl -XDELETE "http://localhost:9200/testindex"
curl -XPOST "http://localhost:9200/testindex" -d'
{
"mappings" : {
"article" : {
"dynamic" : false,
"properties" : {
"text" : {
"type" : "string",
"analyzer" : "snowball"
}
}
}
}
}'
...我填充以下内容:
curl -XPUT "http://localhost:9200/testindex/article/1" -d'{"text": "grey"}'
curl -XPUT "http://localhost:9200/testindex/article/2" -d'{"text": "gray"}'
curl -XPUT "http://localhost:9200/testindex/article/3" -d'{"text": "greyed"}'
curl -XPUT "http://localhost:9200/testindex/article/4" -d'{"text": "greying"}'
...我在搜索时看到以下内容:
curl -XPOST "http://localhost:9200/testindex/_search" -d'
{
"query": {
"query_string": {
"query": "grey",
"analyzer" : "snowball"
}
}
}'
结果是
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.30685282,
"hits": [
{
"_index": "testindex",
"_type": "article",
"_id": "1",
"_score": 0.30685282,
"_source": {
"text": "grey"
}
}
]
}
}
...我期待 3 次点击:grey
、greyed
和greying
. 为什么这不起作用?请注意,我对在搜索中添加模糊性不感兴趣,因为默认情况下它将匹配灰色(但不是灰色)。
我在这里做错了什么?