本文共 1106 字,大约阅读时间需要 3 分钟。
普通match如何转换为term+should
{ "match": { "title": "java elasticsearch"}}
{ "bool": { "should": [ { "term": { "title": "java" }}, { "term": { "title": "elasticsearch" }} ] }}
and match如何转换为term+must
{ "match": { "title": { "query": "java elasticsearch", "operator": "and" } }}
转化后
{ "bool": { "must": [ { "term": { "title": "java" }}, { "term": { "title": "elasticsearch" }} ] }}
minimum_should_match如何转换
{ "match": { "title": { "query": "java elasticsearch hadoop spark", "minimum_should_match": "75%" } }}
转化后
{ "bool": { "should": [ { "term": { "title": "java" }}, { "term": { "title": "elasticsearch" }}, { "term": { "title": "hadoop" }}, { "term": { "title": "spark" }} ], "minimum_should_match": 3 }}
转载地址:http://ueonn.baihongyu.com/