Django filter custom look up

How can I add custom filtering to Django search? currently lookup_expr='icontains' match the words that contains string.

Example:

I want to search the work "elephant". if i type ele, phant , then icontains works. But if i type elepant (missed h) then icontains wont return anything.

So I want to build the search text that matches similar word. How can I do that in django?


This is called "full text search". If you are using postgres database then django has some native support for it. Otherwise, there is a huge branch of software devoted just to full text search out there, can start your journey here.

链接地址: http://www.djcxy.com/p/6596.html

上一篇: 在进行HTTP调用时,在Ruby中经常使用SystemExit

下一篇: Django过滤器自定义查找