假设名称为 comment
的多值、存储和索引字段.
执行搜索时,我只想返回comment
其中包含匹配。例如:
当搜索“黄金”而不是得到这个结果时:
<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>
我更愿意得到这个结果:
<doc>
<arr name="comment">
<str>all that glitters is gold</str>
</arr>
</doc>
(内存中的伪 XML,可能不准确,但说明了这一点)
谢谢。
最佳答案
考虑到与其他 Solr 用户的对话让我相信这是一个有用的功能,我提交了一个功能请求:
Solr: Return only matched multiValued field
关于solr - 仅返回匹配的多值字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12377718/