Here’s an easy wrapper for ElasticSearch using request and json.
request
json
import requests import json def es_wildcard_query(uri, key, term): """Wildcard Elasticsearch Query""" query = json.dumps({ "query": { "wildcard": { key: '*%s*' % term } } }) response = requests.get(uri, data=query) results = json.loads(response.text) return results # Sample Usage: # print es_wildcard_query('http://your_es_url/_search?', 'key', 'search_term')