aparo / pyes

Python connector for ElasticSearch - the pythonic way to use ElasticSearch
BSD 3-Clause "New" or "Revised" License
607 stars 270 forks source link

Filtering on specific fields when using suggestion #510

Open carllopez opened 8 years ago

carllopez commented 8 years ago

Considering the following:

obj = pyes.Suggest() obj.add_completion(text, 'region', 'suggest_region', size=size) obj.add_completion(text, 'city', 'suggest_city', size=size)

is there a way to add an exclude filter on a field, eg.

obj.add_exclusion('Spain', 'country')

to not return results that match country='Spain' ?