You can download the django-sphinx application from its repository on GitHub by visiting the following URL and clicking on the Download button: http://github.com/dcramer/django-sphinx/.
It is also available through the easy_install
tool by issuing the following command:
$ sudo easy_install django-sphinx
Once installed, you can add the django-sphinx layer to any model and take advantage of a very simple interface to search and retrieve Django model objects from your database tables. The only requirement is to create the source and indexes exactly as we did earlier and specify which index django-sphinx
should search when you attach it to your models.
For example, to use django-sphinx on our Product
model from chapter 2, we would change the model definition to include the SphinxSearch
manager.
from djangosphinx.models import SphinxSearch class Product(models.Model): category = models.ForeignKey('CatalogCategory', ...