Django provides the API for PostgreSQL full text search. It would be convenient to expose this API to the graphql filter level. The additional lookup with the name fullsearch can be added for implementation. For instance
import graphene
from graphene_django_filter import AdvancedFilterSet
from graphene_django import DjangoObjectType
class TaskFilter(AdvancedFilterSet)
class Meta:
model = Task
fields = {
'name': ('exact', 'contains', 'fullsearch')
}
class UserType(DjangoObjectType):
class Meta:
model = User
interfaces = (graphene.relay.Node,)
fields = '__all__'
filter_fields = {
'name': ('exact', 'contains', 'fullsearch')
}
One of the full search queries could look like this.
Django provides the API for PostgreSQL full text search. It would be convenient to expose this API to the graphql filter level. The additional lookup with the name
fullsearch
can be added for implementation. For instanceOne of the full search queries could look like this.