elasticsearch 查询弹性搜索时没有匹配项
我正在尝试运行查询搜索。何时运行此查询elasticsearch 查询弹性搜索时没有匹配项,elasticsearch,kibana,elastic-stack,elasticsearch,Kibana,Elastic Stack,我正在尝试运行查询搜索。何时运行此查询 GET accounts/_search/ { "query": { "term": { "address_line_1": "1000" } } } 我找回了多张唱片,比如 "hits" : [ { "_index" : "accounts",
GET accounts/_search/
{
"query": {
"term": {
"address_line_1": "1000"
}
}
}
我找回了多张唱片,比如
"hits" : [
{
"_index" : "accounts",
"_type" : "_doc",
"_id" : "...",
"_score" : 8.355149,
"_source" : {
"state_id" : 35,
"first_name" : "...",
"last_name" : "...",
"middle_name" : "P",
"dob" : "...",
"status" : "ACTIVE",
"address_line_1" : "1000 BROADROCK CT",
"address_line_2" : "",
"address_city" : "PARMA",
"address_zip" : "",
"address_zip_plus_4" : ""
}
},
但是,当我试图将其扩展到包含以下内容时,我没有得到任何匹配项
GET accounts/_search/
{
"query": {
"term": {
"address_line_1": "1000 B"
}
}
}
答案是
{
"took" : 0,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 0,
"relation" : "eq"
},
"max_score" : null,
"hits" : [ ]
}
}
术语
查询正在查找精确匹配项。您的address\u line.*
字段很可能使用标准分析器编制索引,该分析器将所有字母小写,从而阻止查询匹配
所以要么使用
GET accounts/_search/
{
"query": {
"match": { <--
"address_line_1": "1000 B"
}
}
}
GET accounts/\u搜索/
{
“查询”:{
“匹配”:{这很有帮助,但我得到的点击率实际上并不匹配。明白了--在这种情况下,请查看match_短语查询:但是请记住,这不会处理拼写错误和模糊匹配--您可能需要检查自动完成策略:尝试match_短语和match_短语前缀。这两种方法都不起作用媒体帖子帮助的案例。不得不做“地址行1.关键字”: