2

Say I have a field in Solr which has the value, "The rain in Spain falls mainly in the plain."

And I want a highlighted result for the phrase, "falls mainly".

I pass these parameters to the 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 comes back 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>

What I would have expected was the phrase 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.

dacracot
  • 22,002
  • 26
  • 104
  • 152

0 Answers0