我正在尝试__exact
在我的 Haystack 和 SOLR4 后端应用程序中使用,但它不能SQ()
按预期工作。我想知道是否__exact
只适用于SearchQuerySet
课堂。这是我的代码:
sqs = super(FacetedSearchForm, self).search()
author_sq = SQ()
title_sq = SQ()
author_sq.add(SQ(author__exact=sqs.query.clean(author)), SQ.OR)
title_sq.add(SQ(title__exact=sqs.query.clean(title)), SQ.OR)
sqs = sqs.filter(author_sq)
sqs = sqs.filter(title_sq)
有没有人知道如何__exact
为上课找工作SearchQuery
?