3
我試圖在通過Python API查詢ES服務器時在多個字段上進行匹配。但無法弄清楚Python中的語法:Elasticsearch - Python客戶端 - 如何匹配多個字段?
我試過了;
res = es.search(index="pyats", doc_type="router_show", body={"query": {"match": {"name": "mark"} AND {"age": "21"}}}, size=1000)
和
res = es.search(index="pyats", doc_type="router_show", body={"query": {"match_all": {"name": "mark"} AND {"age": "21"}}}, size=1000)
和
res = es.search(index="pyats", doc_type="router_show", body={"query": {"match": {"name": "mark"}}, {"match": {"age": "21"}}}, size=1000)
任何意見將不勝感激。 沒有,似乎工作。
善舉upvote ... – harshil9968