开发者

Django search capabilities

开发者 https://www.devze.com 2022-12-13 05:55 出处:网络
Is there a easy way to add a search capability on fields in Django? Also please let 开发者_C百科me know what is Lucene search.

Is there a easy way to add a search capability on fields in Django? Also please let 开发者_C百科me know what is Lucene search.


  1. Try Haystack. It's pretty easy to setup.
  2. Apache Lucene is full-text search engine written in Java.


I would use Haystack as mentioned above together with Xapian.

Xapian doesn't require you to run it as a process (which is some sort of advantage in my opinion).


I second the Haystack suggestion. Here's a good blog post about it. In fact, the entire series—Large Problems in Django, Mostly Solved—is excellent reading. Here's a Google search that should find most of the entries.


If your database is MySQL don't underestimate the power of QuerySet's search method. It uses MySQL's full-text index (assuming you've created one) to do full-text searching. It's the quickest to set up of all the options (it's built in!) and depending on your requirements it may be enough. If not, I also think Haystack is a good suggestion.


Haystack setup on my blog application took me <30 min as Django newbie. I can strongly recommend it.

0

精彩评论

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