Django search capabilities
Is there a easy way to add a search capability on fields in Django? Also please let 开发者_C百科me know what is Lucene search.
- Try Haystack. It's pretty easy to setup.
- 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.
精彩评论