Created
July 10, 2019 11:33
-
-
Save harshvb7/c8983eb2cae44f8954391dbbc56a2181 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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