I've got the following Restaurant and the Comment models. I'm doing
full text search on some fields of the Restaurant model, as shown
below in the RestaurantIndexer class. How can I do a full text search
including the comments (i.e. a search returning Restaurant instances
with the query contained in one or some fields defined in
RestaurantIndexer or in the comment field of Comment instances)?
*********Restaurant model***************
class Restaurant(models.Model):
name = models.CharField(max_length=100)
country=models.ForeignKey(Country)
city=models.ForeignKey(City)
street=models.CharField(max_length=100)
street_number=models.PositiveSmallIntegerField()
postal_code=models.PositiveIntegerField(blank=True,
null=True)
category=models.ManyToManyField(Category, blank=True,
null=True)
slug = models.SlugField(unique=True)
*********Comment model***************
class Comment(models.Model):
user = models.ForeignKey(User)
restaurant = models.ForeignKey(Restaurant)
submit_date = models.DateTimeField(blank = True, null = False)
comment = models.TextField()
*********Restaurant indexer***************
class RestaurantIndexer(Indexer):
tags = [
('name','name'),
('city','city'),
('country','country'),
('category', 'category'),
('tag','tag')
]
space.add_index(Restaurant, RestaurantIndexer, attach_as='indexer')
--
You received this message because you are subscribed to the Google Groups "Djapian Users" group.
To post to this group, send email to djapia...@googlegroups.com.
To unsubscribe from this group, send email to djapian-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/djapian-users?hl=en.
> > djapian-user...@googlegroups.com<djapian-users%2Bunsu...@googlegroups.com>