Sphene Community Tools

Community

Copyright © 2007 by Herbert Poul
You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Search

Search

This document describes on how to set up search for SCT.

1. General

The search applications are decoupled from the actual wiki, forum,.. applications to not depend on any search engine. These applications are located in sphene.sphsearch* - for example sphene.sphsearchboard. (The Board/Forum is currenty the only application supporting search.)

SCT makes use of a modified version of djapian.

Currently only the Forum supports search.

2. Requirements

2.1. Xapian

Please follow the documentation on how to set up xapian:

2.2. Djapian

SCT uses a slightly modified version of djapian .. use the following command to get it from the repository:

svn co http://yourhell.com/svn/root/django/communitytools_vendor/

afterwards add communitytools_vendor/vendor/djapian/src/djapian to your PYTHONPATH (either by symlinking it into site-packages or defining the system property PYTHONPATH or modifying your settings_local.py

Now add djapian to your INSTALLED_APPS and run ./manage.py syncdb - this should create the Change model from djapian.

Daemon: for indexing to work correctly you have to setup the daemon - see http://code.google.com/p/djapian/wiki/Architecture

3. Activate search

Since as of writing only the forum has a search application called sphsearchboard i explain it with it.

3.1. Installed Apps

Add the application 'sphene.sphsearchboard' to your INSTALLED_APPS (in settings_local.py).

3.2. URL Configuration

Add a URL to your url patterns (e.g. in communitydraft this would be communitydraft/community/urlconfs/community_urls.py):

(r'^board/search/', include('sphene.sphsearchboard.urls'), community_urls.defaultdict),

3.3. Initial update

after activating search you need to update the whole index once to find anything. (all changes to models afterwards should be catched by the daemon and updated automatically.)

herbert-pouls-computer:~/dev/python/sphenecommunity/sphenecommunity herbert$ python2.5 ./manage.py shell
Executing module body.

>>> from sphene.sphsearchboard import models
>>> models.post_index.update()
>>>

4. Deployment

mod_python (3.3.1) has a problem which prevents the xapian bindings from working correcty. So you can not use the search with mod_python !

I am currently using mod_wsgi - Here you have to make sure to use the following apache directive:

WSGIApplicationGroup %{GLOBAL}

Tags:

Last Modified: 2008-04-28 21:29:33 by Herbert Poul - [ Snip Changes ] [ Wiki History ]

0 Comments

No comments yet.

Post New Thread



Powered by Sphene Community Tools