I have a hay search that has the following SearchIndex:
class GrantIndex (indexes.SearchIndex):
"" "
This provides the search index for the Grant application.
"" "
text = indexes.CharField (document = True, use_template = True)
year = indexes.IntegerField (model_attr = 'year__year')
date = indexes.DateField (model_attr = 'date')
program = indexes.CharField (model_attr = 'program__area')
grantee = indexes.CharField (model_attr = 'grantee')
amount = indexes.IntegerField (model_attr = 'amount')
site.register (Grant, GrantIndex)
If I want to search for filtering of any programs that are NOT "Health", I run the following query:
from haystack.query import SearchQuerySet
sqs = SearchQuerySet ()
sqs = sqs.filter (program = 'Health')
Unfortunately, this also creates objects from the "Health \ Other" and "Health \ Cardiovascular" programs. How to stop the search to enable these other programs?
I am running Ubuntu 9.10 with Xapian as the search source code.
source
share