Solr - 获取构面计数而不返回搜索结果
我只需要从 solr 返回方面计数。 所以我基本上想搜索所有文档并返回构面计数,但我不想返回任何搜索结果。 这可能吗?
谢谢
I need to return only the facet counts from solr. So I basically want to search over all documents and return the facet counts, but I don't want to return any search results. Is this possible?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
设置
facet=true
将启用分面,设置rows=0
将阻止返回任何结果。numFound
将方便地显示找到了多少个结果。Setting
facet=true
will enable faceting and settingrows=0
will prevent any results being returned. Conveniently thenumFound
will show you how many results were found.我想明显的解决方案是使用通配符进行搜索并指定您希望返回零结果。
到目前为止,这就是我的解决方案。
I guess the obvious solution would be to search using a wildcard and specify that you want zero results returned.
That's my solution so far.
因此,根据我的理解,如果我需要获取分页系统中所有文档的构面计数,我需要发出两个请求(选择):
- 第一个获得所有文档的构面计数。
- 第二个是从当前页面获取文档。
So, from what I have understood if I need to get facets count for all documents in a paginated system, I need to make two requests (selects):
- The first to get the facets count for all documents.
- And the second to get the documents from current page.