I recently had to do something similar, and it was a pain in the ass. I could not find another way to do this.
First of all, to solve the Haystack problem, which works on many models, and therefore the filter returns all matches:
Haystack handles filtering the model behind the scenes using a property that it indexes as django_ct, which is equal to the application name and model name. In my particular case, it looked like django_ct='books.Title' .
You can try filtering by doing
SearchQuerySet.filter(content=term, django_ct='app.Model')
But I donβt know if this will work like that. In my specific case, I still had to do an raw search, so I managed to add filtering directly to this:
sqs = SearchQuerySet() sqs = sqs.raw_search(u'(title:(%s)^500 OR author:"%s"^400 OR "%s"~2 OR (%s)) AND (django_ct:books.Title)' % term)
No matter how you get it, after you get the SearchQuerySet that you want to do additional filtering without updating the index, you have to do it with your own code.
# each item in a queryset has a pk property to the model instance it references pks = [item.pk for item in list(sqs)]
Of course, you can combine the last two queries, I just divided them into explicit ones.
This is not a lot of code, but it took me a long time to get it working for various reasons. Hope this helps you.