POST /match_test/_search { "query": { "match_bool_prefix":{ "my_text": { "query": "food p" } } } } 查询分析: 1. ”food p“经过分词将会变成food和p; 2. 把food分词应用于term查询,p分词应用于prefix查询; 3. 因为doc1和doc2的my_text分词后都有food和以p开头(porridge)的分词,所以...
match_bool_prefix 查询内部将输入文本通过指定analyzer分词器处理为多个term,然后基于这些个term进行bool query,除了最后一个term使用前缀查询 其它都是term query。 查询语句: GET /_search { "query": { "match_bool_prefix" : { "message" : "quick brown f" } } } 类似于: GET /_search { "query"...
match_phrase_prefix 查询是 match_phrase 查询的一个变种,它允许对查询短语的最后一个单词进行前缀匹配。 适用场景:适用于需要匹配以特定前缀开头的短语且对查询精度要求较高的场景。这里查询要求前缀匹配,类似于 mysql 的 like 查询 的 “保存%” GET crm_meiqia_conversation_tmp/_search { "query": { "bool"...
{"bool": {"should": [ {"match": {"title":"quick brown fox"}}, {"match": {"title.original":"quick brown fox"}}, {"match": {"title.shingles":"quick brown fox"}} ] } } 3,phrase和phrase_prefix查询类型 该类型的query是phrase,在每个字段上执行查询,然后返回最高的评分,类似于best_f...
"bool": { "must": [ { "term" : { "convId" : 6305271104 } } , { "match_phrase": { "convContent.content": "哦 一下 保存 " } } ] } } } 查询结果如图 match_phrase_prefix 查询 match_phrase_prefix 查询是 match_phrase 查询的一个变种,它允许对查询短语的最后一个单词进行前缀匹配。
match_phrase_prefix 查询是 match_phrase 查询的一个变种,它允许对查询短语的最后一个单词进行前缀匹配。 适用场景:适用于需要匹配以特定前缀开头的短语且对查询精度要求较高的场景。这里查询要求前缀匹配,类似于 mysql 的 like 查询 的 “保存%” GET crm_meiqia_conversation_tmp/_search{"query": {"bool": ...
match查询是一种bool类型的查询。什么意思呢?举个例子,查询 people type 的 hobbies 为football basketball GET matchtest/people/_search { "query": { "match": { "hobbies": "football basketball" } } } 会将上面的两个文档都搜索出来。为什么?上面的查询其实隐藏了一个默认参数operator, 它的默认值是or...
我们用match_phrase_prefix来搞: GET t3/_doc/_search { "query": { "match_phrase_prefix": { "desc": "bea" } } } 结果如下: { "took" : 1, "timed_out" : false, "_shards" : { "total" : 5, "successful" : 5, "skipped" : 0, "failed" : 0 }, "hits" : { "total" ...
"bool": { "should": [ { "match": {"title":"quick brown fox" }}, { "match": {"title.original":"quick brown fox" }}, { "match": {"title.shingles":"quick brown fox" }} ] } } 3,phrase和phrase_prefix查询类型 该类型的query是phrase,在每个字段上执行查询,然后返回最高的评分,类似...
{"query": {"match_bool_prefix": {"name":"quick brown f"} } } 其中分析生成Term [quick,brown,f]类似于下面的bool查询。 GET order/_search {"query": {"bool": {"should": [ {"term": {"name":"quick"}}, {"term": {"name":"brown"}}, ...