1

This is very curious. Highlighting works fine in every other case, but there's this one case it doesn't return any fragments. My document is as follows (fieldType text_en):

Abu Yahya Suhaib bin Sinan (May Allah be pleased with him) reported that: The Messenger of Allah (PBUH) said, "How wonderful is the case of a believer; there is good for him in everything and this applies only to a believer. If prosperity attends him, he expresses gratitude to Allah and that is good for him; and if adversity befalls him, he endures it patiently and that is better for him".[Muslim].

My query is

"wonderful is the case of a believer"

Solr finds the document to return alright, but the highlighting component of the return value doesn't contain the text of the document. It has a field for the primary key of the document (like always) but nothing deeper than that.

If I remove the last word, everything works properly. If I remove the last word from the quotes and place it outside, it works. It even works with a longer (different) string in quotes. It just doesn't work for this!

How do I begin debugging this?

I don't have any highlighting setup in schema.xml and here are the parameters I'm passing as part of he query: &hl=true&hl.fl=hadithText&hl.snippets=50&hl.fragsize=2500&hl.mergeContiguous=true&defType=edismax&mm=3<-1%205<-2&hl.usePhraseHighlighter=true

Kevin Reid
  • 37,492
  • 13
  • 80
  • 108
Ansari
  • 8,168
  • 2
  • 23
  • 34
  • What is the definition of `text_en` in `schema.xml`? Is `stored` set to `true` in the field definition? – kpentchev Sep 02 '12 at 21:55
  • @kpentchev `stored` is `true` and `text_en` tokenizes, removes stop words, downcases, stems, etc. Like I said, highlighting works perfectly fine with other documents and other queries on the same field – Ansari Sep 02 '12 at 22:22
  • The class you would be interested in for debugging is `org.apache.solr.highlight.DefaultSolrHighlighter`. – kpentchev Sep 03 '12 at 10:18

0 Answers0