I want to read the documents from a specific index and a specific type from elastic search. I construct the query:
es.search(index="document_index, doc_type="document_type", body={"query": {"match_all": {}}})['hits']['total']
I receive the error TypeError: search() got an unexpected keyword argument 'doc_type'. I went through a couple of links given below to look for a solution but everywhere the main answer is to downgrade the ES version. But our requirement is to keep ES version 5.6.
- https://elasticsearch-py.readthedocs.io/en/master/
- https://towardsdatascience.com/getting-started-with-elasticsearch-in-python-c3598e718380
- https://marcobonzanini.com/2015/02/02/how-to-query-elasticsearch-with-python/
and a couple of more
Is there an alternative to mention the document type?