I am building a site in which I want to implement text search for the title and description of some objects. Since I will have little amount of objects (~500 documents) I am not considering Haystack and the such.
I only need 2 features:
I have looked into django-watson and django-full-text-search but I am not sure if they allow partial matching. Any ideas?
How many hits by second have your site? Each document, how many data stores?
If we are talking about 500 docs and few hits by minute perhaps django api is enough:
q = None
for word in search_string.split():
q_aux = Q( title__icontains = word ) | Q( description__icontains = word )
q = ( q_aux & q ) if bool( q ) else q_aux
result = Document.objects.filter( q )
You ever considered this option?
Be careful:
As the creator of django-watson, I can confirm that, with some database backends, it allows partial matches. Specifically, on MySQL and PostgreSQL, it allows prefix matching, which is a partial match from the beginning of a word.
Check out this database comparison page on the wiki:
https://github.com/etianen/django-watson/wiki/Database-support
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With