<p>我有一个干草堆搜索,它有以下搜索索引:</p>
<pre>
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)
</pre>
<p>如果我要搜索筛选出任何不“Health”的程序,我运行以下查询:</p>
^{pr2}$
<p>不幸的是,这也会从程序“Health\Other”和“Health\cardional”生成对象。如何阻止搜索允许其他程序进入?在</p>
<p>我运行Ubuntu9.10,Xapian作为我的搜索后端。在</p>