Skip to content

Instantly share code, notes, and snippets.

@harshvb7
Created July 10, 2019 12:04
Show Gist options
  • Save harshvb7/9a3cf9b2895935d8e0dafb4af52f0efd to your computer and use it in GitHub Desktop.
Save harshvb7/9a3cf9b2895935d8e0dafb4af52f0efd to your computer and use it in GitHub Desktop.
# we also index a keyword version of the field
name = Text(
analyzer=my_custom_analyzer,
fields={'keyword': es.Keyword()}
)
# and use it with facets like this
'city': TermsFacet(field='user.city.name.keyword'),
# so now we can use the same field for free text search as well as filters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment