I am desperately trying to perform a simple search operation on elasticsearch, but fail since hours. This is my code:
res = es.search(index="people", doc_type="test", body={"query":{"match":{"name": "john"}}})
I saw this many times on the internet, but I get always an error and have no clue what is wrong with my code snippet.
Traceback (most recent call last):
File "./es_request.py", line 14, in <module>
res = es.search(index="people", doc_type="test", body={"query":{"match":{"name": "john"}}})
File "/usr/local/lib/python3.4/dist-packages/pyelasticsearch/client.py", line 93, in decorate
return func(*args, query_params=query_params, **kwargs)
TypeError: search() missing 1 required positional argument: 'query'
Where do I have to write the required 'query'? I am trying to perform the search for name and last name.