Does haystack have a exists(), similar to Django's queryset's exists()?

36 views
Skip to first unread message

Anuvab Mohanty

unread,
Nov 28, 2016, 1:51:52 PM11/28/16
to django-haystack
There are a lot of times when I just need to make sure that a result exists and perform some action according to that, but I have to call self.results.count() and check it's value. It seems like an unnecessary extra query to me. Django's querysets solve this by using queryset.exists(), does haystack have an equivalent method?

Anuvab Mohanty

unread,
Nov 28, 2016, 10:46:16 PM11/28/16
to django-haystack
If not, I can look into adding such a method. I already use a mostly functional version of this method for my own classes, it can probably be refitted into haystack.
Reply all
Reply to author
Forward
0 new messages