如何获取haystack搜索中搜索结果的数量?
我正在使用 django-haystack 进行搜索。如何在模板中显示使用数据库中的干草堆搜索找到的搜索结果的数量?我的意思是我必须在哪里更改我的干草堆视图才能获取搜索查询的计数。非常感谢帮助。
I am using django-haystack for searching. How can i display in the template the count of search results found using haystack search in database? I mean where do i have to change my haystack views to get the count of searchquery. Would really appreciate help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SearchQuerySet.count()
怎么样?在模板中,它将是{{ mysearchqueryset.count }}
http://readthedocs.org/docs/django-haystack/en/latest/searchqueryset_api.html#count
How about
SearchQuerySet.count()
? In the template, it would be{{ mysearchqueryset.count }}
http://readthedocs.org/docs/django-haystack/en/latest/searchqueryset_api.html#count