-
-
Save csarcom/0873f6e7816f7b75240a3828e11a7136 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class AnimalDoc(Document): | |
_id = Text() | |
class Index: | |
name = 'animal' | |
# Object type definition | |
class Animal(ElasticsearchObjectType): | |
class Meta(object): | |
document = AnimalDoc | |
# interfaces = (Node,) | |
filter_backends = [ | |
FilteringFilterBackend, | |
SearchFilterBackend, | |
OrderingFilterBackend, | |
DefaultOrderingFilterBackend, | |
] | |
# For `FilteringFilterBackend` backend | |
filter_fields = { | |
'_id': { | |
'field': '_id.keyword', | |
'default_lookup': LOOKUP_FILTER_TERM, | |
} | |
} | |
class AnimalQuery(graphene.ObjectType): | |
all_animals = ElasticsearchConnectionField(Animal) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment