Matching fields in queries with or without tildes in django
I have a search functionality where I find objects matching text with field__icontain开发者_开发知识库s=text, the problem is that it wont find for example 'mecánico' if the search term is 'mecanico', I want it to match it either way, is that possible?
If you need complicate search, may be it would be better to use some search engine - solr
, sphinx
or something. It is a good app for linking django with different search engines - django-haystack
.
Maybe you can try a regex
lookup: http://docs.djangoproject.com/en/dev/ref/models/querysets/#regex
精彩评论