Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

solr

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. :)

like image 457
Kimber Avatar asked Dec 12 '12 18:12

Kimber


1 Answers

Solved it.

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

Discussed here

like image 152
techfoobar Avatar answered Nov 12 '22 22:11

techfoobar