我可以使用Solr术语组件对非术语字段进行过滤(Can I use Solr term component with filtering on non

编程入门 行业动态 更新时间:2024-10-28 16:16:54
我可以使用Solr术语组件对非术语字段进行过滤(Can I use Solr term component with filtering on non-term fields)

HTTP://本地主机:8080 /搜索/项terms.prefix = AB&terms.fl =文字和terms.sort =计

我有上述条款查询,我的工作正常。 返回“text”字段中具有特定前缀的所有术语,按count排序。

我想只返回另一个字段“language”为“en”的术语,我可以在术语查询中添加这样的过滤器吗?

http://localhost:8080/search/terms?terms.prefix=ab&terms.fl=text&terms.sort=count

I have the above terms query which works as I expect. Returns all the terms from the "text" field that have a certain prefix, sorted by count.

I want to return only the terms where another field "language" is "en" can I add such a filter to a terms query?

最满意答案

遗憾的是,您无法通过TermsComponent访问字段中的索引术语时进行TermsComponent 。 例如,当您提出自动建议时,这是您面临的限制之一。 如果您正在进行自动建议,支持过滤的方法之一是基于facet和前缀参数,如此处所述。

Unfortunately you can't filter while accessing the indexed terms within a field through the TermsComponent. That's one of the limitations you face when you make auto suggestions for example. If you're making auto-suggestions, one of the ways that supports filtering is based on a facet and the prefix parameter like explained here.

更多推荐

本文发布于:2023-07-20 05:52:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1194818.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:术语   可以使用   字段   组件   Solr

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!