This isn\'t really a complex problem (to my knowledge).
I know in MongoDB you can feed in a string and it automatically tokenizes and performs full-text search using
To perform Full Text Search with Django you have to combine using GiN index
with SearchVector
.
Here is full working example what I used somewhere. It works also on 2+ words in a query and searches them in 3 fields.
You can use more than one word in SearchQuery
. You can even get rid of SearchQuery if you don't need to search by logical combination of terms:
Entry.objects.annotate(
search=SearchVector('body_text'),
).filter(search="Multiple words query")