I have a piece of python query to retrieve data from elasticsearch:-
es=Elasticsearch(['http://localhost:9200'])
res = es.search(index="index1", doc_type="log",size=1000, from_=0, body={ "query": {
"match": {
....Match condition
}
}
}})
Is there any way we can pass the index as parameter i.e assign the value of index1 outside the query and then use it for extracting results?