Skip to content

Instantly share code, notes, and snippets.

@harshvb7
Created Jul 10, 2019
Embed
What would you like to do?
from elasticsearch_dsl import FacetedSearch, TermsFacet
class TweetSearch(FacetedSearch):
facets = {
# use bucket aggregations to define facets
'city': TermsFacet(field='user.city.name'),
}
def search(self):
s = super().search()
# override the search queryset here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment