本文介绍了仅返回匹配的多值字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设有一个名称为 comment 的多值、存储和索引字段.执行搜索时,我只想返回comment 包含匹配.例如:

Assuming a multivalued, stored and indexed field with name comment.When performing a search, I would like to return only the values ofcomment which contain the match. For example:

当搜索gold"而不是得到这个结果时:

When searching for "gold" instead of getting this result:

<doc>
    <arr name="comment">
        <str>Theres a lady whos sure</str>
        <str>all that glitters is gold</str>
        <str>and shes buying a stairway to heaven</str>
    </arr>
</doc>

我更愿意得到这个结果:

I would prefer to get this result:

<doc>
    <arr name="comment">
        <str>all that glitters is gold</str>
    </arr>
</doc>

(记忆中的伪 XML,可能不准确但说明了这一点)

(psuedo-XML from memory, may not be accurate but illustrates the point)

谢谢.

推荐答案

考虑到与其他 Solr 用户的对话让我相信这是一个有用的功能,我提交了一个功能请求:

Considering conversations with other Solr users lead me to believe that this is a useful feature, I have filed a feature request:

Solr:仅返回匹配的多值字段

这篇关于仅返回匹配的多值字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 15:18