How to get the number of search results in a hay search?

I am using django-haystack to search. How can I display in the template the number of search results found by searching for hay in the database? I mean, where do I have to change my hay views in order to get the number of searches. It would be very helpful to help.

+4
source share
1 answer

What about SearchQuerySet.count() ? In the template, this will be {{ mysearchqueryset.count }}

http://readthedocs.org/docs/django-haystack/en/latest/searchqueryset_api.html#count

+4
source

Source: https://habr.com/ru/post/1391701/


All Articles