我正在为弹性索引字符串“ 10 GIPPS STREET BARTON ACT 2600” 2.4和6.3。
尝试按搜索字符串“ 26”进行搜索
弹性搜索2.4不返回任何结果,而6.3返回 预期结果。在2.4中建立索引的请求:
PUT - https://localhost:9200/searchtermtest
{“映射”:{ “ testindex_type”:{ “属性”:{ “搜索词”: { “ type”:“字符串” } } }}
Add Index Request:
https://localhost:9200/searchtermtest/searchtermtest_type/1
{ "SearchTerm": "10 GIPPS STREET BARTON ACT 2600" }
My search call request in 2.4 is: { "from" : 0, "size" : 10,
"query" : {
"bool" : {
"must" : {
"match_all" : { }
},
"filter" : {
"bool" : {
"must" : {
"match" : {
"SearchTerm" : {
"query" : "60",
"type" : "boolean",
"boost" : 1.0,
"fuzziness" : 2
}
}
}
}
}
} } }
当我在其中索引相同的字符串“ 10 GIPPS STREET BARTON ACT 2600”时, 6.3与2.4相同,并搜索strinf“ 26”,它将返回预期结果。
Search Request in 6.3:
{ "query": { "bool": { "must": [{
"match_all": {
} }], "filter": {
"bool": {
"must": {
"match": {
"SearchTerm": {
"fuzziness": 2,
"query": "26",
"boost": 1.0
}
}
}
} } } }, "from": 0, "size": 10 }
令人惊讶的是,当我搜索2.4中的任何其他字符串时,例如“ 260” 或“ 60”或“ 00”,它会给出预期的结果。仅搜索问题 字符串“ 26”