solr - 仅返回匹配的多值字段

标签 solr

假设名称为 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/

相关文章:

solr - Jetty 日志位置

ruby-on-rails - Errno::ECONNREFUSED 由于目标机器主动拒绝,无法建立连接。 - 在 Rails 应用程序中使用 connect(2) 进行 Mongodb 搜索

search - 具有自动完成功能/建议的 Solr 搜索框?

ruby-on-rails - 在 rails 3 中太阳黑子搜索中的命名范围

java - 如何在HBase中存储和查询范围数据?

mysql - Solr DIH 与 SQL

string - Solr/Lucene : Possible to have Strings tokenized?

lucene - Solr 中的同时查询

java - Apache solr 配置与 tomcat 6.0

solr - 在 SOLR 中索引和查询的最佳标记分析器