带分页、过滤条件的DSL

"query": {
"bool": {
"must_not": {
"match_phrase": {
"product_name": "测试"
}
},
"must": [
{
"match_phrase": {
"product_name": "米"
}
},
{
"query": {
"bool": {
"should": [
{
"match_phrase": {“people_name": "张三"}
}, {
"match_phrase": {"people_name": “李四"}
}
]
}
}
},
{
"range": {
"create_time": {"gte": "1990-06-01", "lt": "2016-06-01"}
}
}
]
}
},
"sort": {"create_time": {"order": "desc"}},
"from": 0,
"size": 10

match_phrase :match_phrase查询首先解析查询字符串来产生一个词条列表。然后会搜索所有的词条,但只保留含有了所有搜索词条的文档,并且词条的位置要邻接。
should : 拼接多个查询结果

上一篇:Python第五章__模块介绍,常用内置模块


下一篇:【Java学习笔记之五】java数组详解