Advertisement
Guest User

Untitled

a guest
Mar 26th, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. body = {"query": {"bool":
  2. {"must": [
  3. {"match": {
  4. "{}".format(key_columns[0]): {"query": elem["{}".format(key_columns[0])], "operator": "and"}}},
  5. {"match": {
  6. "{}".format(key_columns[1]): {"query": elem["{}".format(key_columns[1])], "operator": "and"}}},
  7. {"match": {
  8. "{}".format(key_columns[2]): {"query": elem["{}".format(key_columns[2])], "operator": "and"}}},
  9. {"match": {
  10. "{}".format(key_columns[3]): {"query": elem["{}".format(key_columns[3])], "operator": "and"}}}
  11. ]}}}
  12. print("INFO : search for element in elasticsearch index")
  13. res = self._es.search(index=index, body=body)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement