当通过pythonapi查询ES服务器时,我试图在多个字段上进行匹配。但无法理解Python中的语法:
我试过了
res = es.search(index="pyats", doc_type="router_show", body={"query": {"match": {"name": "mark"} AND {"age": "21"}}}, size=1000)
以及
^{pr2}$以及
res = es.search(index="pyats", doc_type="router_show", body={"query": {"match": {"name": "mark"}}, {"match": {"age": "21"}}}, size=1000)
如有任何建议,将不胜感激。 没有,似乎在工作。在
请确保年龄字段的类型为整数或字符串。解决问题的关键字是
must
。在相关问题 更多 >
编程相关推荐