How to integrate a search engine in a Django site?

145 views
Skip to first unread message

Dado

unread,
Oct 30, 2005, 6:46:50 PM10/30/05
to Django users
Does anybody have any experience in integrating a search engine that
can do full-text search into a Django web site? Perhaps, Lupy or
pyLucene, or something SQL-based like MySQL or PostGres full-text
search queries? Of course the frontend should be a simple search box
where users can input anything from a set of simple words to more
complex queries (like "title:apple* and published:1995").

I would appreciate any input.

Dado

Ian Holsman

unread,
Oct 30, 2005, 7:39:21 PM10/30/05
to django...@googlegroups.com
It isn't *exactly* what you want,
but one of the developers (hugo) has implemented some search
functionality described here:
https://simon.bofh.ms/cgi-bin/trac-django-projects.cgi/wiki/AbstractSearching

I've also modified one of his wrappers to 'improve' the generic list
object to allow basic filtering.
http://svn.zilbo.com/svn/django/common/filter/views/filter.py

hope this helps
--
I...@Holsman.net -- ++61-3-9877-0909
If everything seems under control, you're not going fast enough. -
Mario Andretti

Dado

unread,
Oct 30, 2005, 7:45:41 PM10/30/05
to Django users
Thanx for the link!!! However, it seems like I cannot search across
different models.... even if they have the same attributes that I want
to search.

Dado

hugo

unread,
Nov 1, 2005, 6:38:34 PM11/1/05
to Django users
>Thanx for the link!!! However, it seems like I cannot search across
>different models.... even if they have the same attributes that I want
>to search.

My abstract searching stuff (Ian gave the link) does allow searching
over different models - you just add multiple search definitions. The
models even don't need to have the same fields, as you can describe
what fields to use in every search definition.

A sample search definition file for a larger project is in the SVN
repository of my CMS project:

https://simon.bofh.ms/cgi-bin/trac-django-projects.cgi/file/cms/trunk/apps/cms/search.py

It should work with Django trunk, as it doesn't have any translations.
But it might be that some i18n-related dependency crept in, I mostly
run projects from the i18n branch. And documentatin is a bit sparse
currently, you are mostly down to reading the comments and docstrings
and the bit on the wiki (and digging through the CmsProject source
should help, too).

bye, Georg

Reply all
Reply to author
Forward
0 new messages