Solr highlights each word separately for a phrase request

Let's say I have a field in Solr that reads "The rain in Spain falls mostly on the plain."

And I want a highlighted result for the phrase "mostly hits".

I am passing these parameters to select ...

<lst name="params">
    <str name="hl.fragsize">-1</str>
    <str name="q">"falls mainly"</str>
    <str name="hl.q">"falls mainly"</str>
    <str name="hl.simple.pre">@@pre@@</str>
    <str name="hl.simple.post">@@post@@</str>
    <str name="hl.fl">note</str>
    <str name="hl.maxAnalyzedChars">-1</str>
    <str name="hl">true</str>
    <str name="rows">2147483647</str>
</lst>

      

And the response is returned with each phrase word individually highlighted ...

    <lst name="highlighting">
        <lst name="test">
            <arr name="note">
                <str>
The rain in Spain @@pre@@falls@@post@@ @@pre@@mainly@@post@@ in the plain.
                </str>
            </arr>
        </lst>
    </lst>

      

I would expect the phrase to be highlighted ...

    <lst name="highlighting">
        <lst name="test">
            <arr name="note">
                <str>
The rain in Spain @@pre@@falls mainly@@post@@ in the plain.
                </str>
            </arr>
        </lst>
    </lst>

      

I am using Solr version 4.0.

+1


source to share





All Articles