Hello Panagiotis,

I'm sorry but it's a feature. As for hl.usePhraseHighlighter parameter, when 
you turn off it,
you may get only <em>foo</em> or <em>bar</em> highlighted in your snippets.

Koji

On 2016/09/18 15:55, Panagiotis T wrote:
I'm using Solr 6.2 (tried with 6.1 also)

I created a new core and the only change I made is adding the
following line in my schema.xml

<field name="body_text_en" type="text_general" multiValued="true"
indexed="true" stored="true" termVectors="true" termPositions="true"
termOffsets="true" />

I've indexed two simple xml files. Here's a sample:

<add>
<doc>
<field name="id">foo bar</field>
<field name="body_text_en">foo bar</field>
</doc>
</add>

I'm executing a simple query:
http://localhost:8983/solr/test/select?hl.fl=body_text_en&hl=on&indent=on&q=%22foo%20bar%22&wt=json

And here is the response:

  "response":{"numFound":2,"start":0,"docs":[
      {
        "id":"foo bar",
        "body_text_en":["foo bar"],
        "_version_":1545790848171507712},
      {
        "id":"foo bar2",
        "body_text_en":["I strongly suspect that foo bar"],
        "_version_":1545790848184090624}]
  },
  "highlighting":{
    "foo bar":{
      "body_text_en":["<em>foo</em> <em>bar</em>"]},
    "foo bar2":{
      "body_text_en":["I strongly suspect that <em>foo</em> <em>bar</em>"]}}}

If I append hl.useFastVectorHighlighter=true to my query the
highlighter correctly highlights the phrase as <em>foo bar</em>. Of
course I've tried explicitly appending hl.usePhraseHighlighter=true to
my query but I get the same result. I would like to get the same
result with the standard highlighter if possible.


Regards


Reply via email to