限制/过滤Solr中的多值字段 [英] Limiting / Filtering multivalue fields in Solr
问题描述
...
< doc>
< str name =title>范例< / str>
< arr name =foo>
< str> bar1< / str>
< str> bar2< / str>
< str> bar3< / str>
< str> bar4< / str>
< str> bar5< / str>
< str> bar6< / str>
< / arr>
< / doc>
...
我想限制回应只显示1基于Filter Query请求的foo值。例如,查询: 我想要一个响应: 没有办法过滤响应中返回的多值。 如果您可以使用Facet获取列表,您可以使用 facet.prefix 限制字段foo作为方面返回的值。 Is there a way to limit, or filter, the returned text of a multivalued field in Solr? Given the following document structure in Solr: I'd like to limit the response to only show 1 of the "foo" values based on a Filter Query request. So for example, the query: I would want a response of:
Nope. There is not way to filter the Multivalued Values returned with the response. If you can use Facet to get the list, you can use facet.prefix to limit the values for the field foo returned as facet. 这篇关于限制/过滤Solr中的多值字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
$ p $ select /?q = example& fq = foo:bar2`
code>
...
< doc>
< str name =title>范例< / str>
< arr name =foo>
< str> bar2< / str>
< / arr>
< / doc>
...
尽管你可以很容易的在客户端做到这一点。
...
<doc>
<str name="title">example</str>
<arr name="foo">
<str>bar1</str>
<str>bar2</str>
<str>bar3</str>
<str>bar4</str>
<str>bar5</str>
<str>bar6</str>
</arr>
</doc>
...
select/?q=example&fq=foo:bar2`
...
<doc>
<str name="title">example</str>
<arr name="foo">
<str>bar2</str>
</arr>
</doc>
...
You can easily do it at client side though.