DataFrame.
es_query
Applies an Elasticsearch DSL query to the current DataFrame.
Dictionary of the Elasticsearch DSL query to apply
eland DataFrame with the query applied
Examples
Apply a geo-distance query to a dataset with a geo-point column geoip.location.
geoip.location
>>> df = ed.DataFrame('localhost', 'ecommerce', columns=['customer_first_name', 'geoip.city_name']) >>> df.es_query({"bool": {"filter": {"geo_distance": {"distance": "1km", "geoip.location": [55.3, 25.3]}}}}).head() customer_first_name geoip.city_name 1 Mary Dubai 9 Rabbia Al Dubai 10 Rabbia Al Dubai 22 Mary Dubai 30 Robbie Dubai <BLANKLINE> [5 rows x 2 columns]
If using an occurrence like must or filter you must nest it within bool:
must
filter
bool
# Correct: df.es_query({ "bool": { "filter": {...} } }) # Incorrect, needs to be nested under 'bool': df.es_query({ "filter": {...} })