Search code examples
pythondjangodjango-haystack

Efficient Django full-text search without Haystack


What's the next best option for database-agnostic full-text search for Django without Haystack?

I have a model like:

class Paper(models.Model):
    title = models.CharField(max_length=1000)

class Person(models.Model):
    name = models.CharField(max_length=100)

class PaperReview(models.Model):
    paper = models.ForeignKey(Paper)
    person = models.ForeignKey(Person)

I need to search for papers by title and reviewer name, but I also want to search from the perspective of a person and find which papers they have and haven't reviewed. With Haystack, it's trivial to implement a full-text index to search by title and name fields, but as far as I can tell, there's no way to do the "left outer join" necessary to find papers without a review by a specific person.


Solution

  • I ended up using djorm-ext-pgfulltext, which provides a simple Django interface for PostgreSQL's built-in full text search features.