Return only matched multiValued field

2019-02-25 13:39发布

问题:

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

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>

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

Thanks.

回答1:

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

Solr: Return only matched multiValued field



标签: solr