如何获取haystack搜索中搜索结果的数量?

发布于 2024-12-27 12:20:23 字数 104 浏览 2 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尐偏执 2025-01-03 12:20:23

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文