先贴代码
POST /db_resource/resourcetitle/_search
{"query":
{"bool":
{"must":{"match":{"LabelNames":"进口奥迪RS5"}},
"must":{"match":{"LabelNames":"电路图"}},
"must":{"match":{"LabelNames":"2012"}}}}
}
我试了一下,这虽然是3个must,但在执行的过程中,只要满足一个must结果就被返回了,我想要必须3个must同时满足,查询语句应该怎么写,谢谢
POST /db_resource/resourcetitle/_search
{"query":
{"bool":
{"must":{"match":{"LabelNames":"进口奥迪RS5"}},
"must":{"match":{"LabelNames":"电路图"}},
"must":{"match":{"LabelNames":"2012"}}}}
}
我试了一下,这虽然是3个must,但在执行的过程中,只要满足一个must结果就被返回了,我想要必须3个must同时满足,查询语句应该怎么写,谢谢
2 个回复
jianjianhe
赞同来自: laoyang360 、dongqing 、ljfphp
productID = "JODL-X-1937-#pV7" AND price = 30
"must" : [ { "term" : {"productID" : "JODL-X-1937-#pV7"}}, { "term" : {"price" : 30}} ]
rhwayfun
赞同来自: dongqing