开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜