简体   繁体   中英

solr search results return a multivalued field as a single string in highlighting

I have a multivalued field that I am searching on. In the 'result' area the field is returned as an array of strings. In the highlighting section the array elements are combined into a single string with no delimiter. Do I have to parse the highlighting based on the results section? It seems like highlighting should return an array of strings.

This is what I get back:

<result name="response" numFound="1" start="0">
    <doc>
        <arr name="NameList">
            <str>Beacher, Mike</str>
            <str>Cally, Karl T.</str>
            <str>Amerson, Judy</str>
        </arr>
    </doc>
</result>
<lst name="highlighting">
    <lst name="my_doc">
        <arr name="NameList">
            <str>Beacher, MikeCally, Karl T.<em>Amerson, Judy</em>
            </str>
        </arr>
    </lst>
</lst>

I was expecting the highlighting result to look something like this:

<arr name="NameList">
    <str>Beacher, Mike</str>
    <str>Cally, Karl T.</str>
    <str><em>Amerson, Judy</em></str>
</arr>

So far I haven't found any questions about this - unless I am just bad at searching. :)

Solved it.

This functionality is now available using the preserveMulti parameter in Solr 4.1.

Discussed here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM