6👍
✅
I use to have a similar problem, as workaround or maybe a Fix you can change the query lookup
results = SearchQuerySet().filter(content__startswith='Sri Ragh')
The issue is that django-haystack doesn’t implement all lingos from search engines. Of course you can do this.
results = SearchQuerySet().raw_search('READ THE SEARCH ENGINE QUERY SYNTAX FOR GET WILDCARD LOOKUPS')
As Django-haystack says, this is not portable.
-1👍
You can use icontains or startswith.
Be careful with this one, if a query is for example ‘r’, this will bring you all ‘Model’ entities that have a ‘r’ in its content.
Model.objects.filter(content__icontains=query)
Model.objects.filter(content__startswith=query)
Look at the documentation
- [Django]-SAML SSO Authentication with Django REST Framework
- [Django]-Better webserver performance for Python Django: Apache mod_wsgi or Lighttpd fastcgi
- [Django]-Django 1.5 gunicorn workers eats memory
- [Django]-Passing value along with form in POST data in Django
Source:stackexchange.com