django - djapian based search returns no result -
I am trying to implement full text search based DJAPPION for searching user profiles in my DJ site. I basically follow these steps to create indexes:
- Modal profile has been updated to add the DJPI indexer.
- Run python manage.py index --rebuild to reconstruct the index.
However, when I try to search using the profile pointer:
Profile.indexer.search ("query")
It does not give me any results, I have not received any error.
Can anyone help me with it? I am a newbie w.r.t. Django + djapian
Update 06/29/09
My index plan resides in definitions and follows:
class profiles (models.model): User = Models.ForeignKey (user, exclusive = true, verbose_name = ('user')) name = model. About Kharefield ( ('name'), max_long = 50, empty = true, empty =) model = model Textfield ( ('about'), null = true, empty = true) organization = model.carfield ( ('organization'), max_length = 100, null = true, empty = true) location = Model.Carfild (_ ('location'), max_long = 40, zero = true, empty = true) website = model. URLField (_ ('website'), tap = true, empty = true, return_exists = false) def Unicode (self): return self. User User Df get_absolute_url (self): returns ('profile_details', none, {'username': self.user.username}) get_absolute_url = Models.permalink (get_absolute_url) class meta: verbose_name = _ ('profile') verbose ( 'Name', 'about', 'organization', 'location'] tag = ['name', '' name '', '' name '' ('profile')
class profilesindexer ('Location', 'organization'), ('location', 'location')]
(about 'about', 'about'),djapian.add_index, profileindexer, attach_as = 'indexer')
It is possible that whatever you are missing,
profile at the end of the model. Index.update ()
is running. Py (You only have to do this once).
Now, I can use the old version of the DJPi, but the following works for me (end of models.py):
profile_indexer = Djapian.Indexer (model = profile, field = [..., ...], tag = [(..., ...), (..., ...)]) Run once and its Post comment to Profile.indexer.update ()
Comments
Post a Comment