I am writing a fairly simple Django application where users can enter string queries. The application will search through the database for this row.
Entry.objects.filter(headline__contains=query)
This query is pretty simple, but not very helpful to someone who is not 100% sure what they are looking for. So I expanded the search.
from django.utils import stopwords
results = Entry.objects.filter(headline__contains=query)
if(!results):
query = strip_stopwords(query)
for(q in query.split(' ')):
results += Entry.objects.filter(headline__contains=q)
I would like to add additional functionality to this. Search for missed words, plurals, regular homophones (sound is written differently in the same way), etc. I'm just wondering if any of these things were built into the Djangos query language. It's not important for me to write a huge algorithm, because I'm really looking for something inline.
Thanks for all the answers.