You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Teague James <te...@insystechinc.com> on 2016/10/24 15:15:38 UTC

Solr 6.0 Highlighting Not Working

Can someone please help me troubleshoot my Solr 6.0 highlighting issue? I
have a production Solr 4.9.0 unit configured to highlight responses and it
has worked for a long time now without issues. I have recently been testing
Solr 6.0 and have been unable to get highlighting to work. I used my 4.9
configuration as a guide when configuring my 6.0 machine. Here are the
primary configs:

solrconfig.xml
In my  query requestHandler I have the following:
<str name="hl">on</str>
<str name="hl.fl">text</str>
<str name="hl.encoder">html</str>
<str name="hl.simple.pre">&lt;b&gt;</str>
<str name="hl.simple.post">&lt;/b&gt;</str>

It is worth noting here that the documentation in the wiki says
hl.simple.pre and hl.simple.post both accept the following:
<str name="hl.simple.pre"><em></str>
<str name="hl.simple.post"></em></str>
Using this config in 6.0 causes the core to malfunction at startup throwing
an error that essentially says that an XML statement was not closed. I had
to add the escaped characters just to get the solrconfig to load! Why? That
isn't documented anywhere I looked. It makes me wonder if this is the source
of the problems with highlighting since it works in my 4.9 implementation
without escaping. Is there something wrong with 6's ability to parse XML?

I upload documents using cURL:
curl http://localhost:8983/solr/[CORENAME]/update?commit=true -H
"Content-Type:text/xml" --data-binary '<add><doc><field
name="id">7518</field><field name="observation">TEST02. This is the second
test.</field></doc></add>'

When I search using a browser:
http://50.16.13.37:8983/solr/pp/query?indent=true&q=TEST04&wt=xml

The response I get is:
<result name="response" numFound="1" start="0" maxScore="2.2499826"> <doc>
<str name="id">7518</str> <str name="observation"> TEST02. This is the
second test.
</str>
<arr name="text">
<str>
TEST02. This is the second test.
</str>
</arr>
<long name="_version_">1548827202660859904</long>
<float name="score">2.2499826</float>
</doc>
</result>
<lst name="highlighting">
<lst name="7518"/>
</lst>

Note that nothing appears in the highlight section. Why?

Any help would be appreciated - thanks!

-Teague


RE: Solr 6.0 Highlighting Not Working

Posted by Teague James <te...@insystechinc.com>.
Hi - Thanks for the reply, I'll give that a try.  

-----Original Message-----
From: jimtronic [mailto:jimtronic@gmail.com] 
Sent: Monday, October 24, 2016 3:56 PM
To: solr-user@lucene.apache.org
Subject: Re: Solr 6.0 Highlighting Not Working

Perhaps you need to wrap your inner "<em>" and "</em>" tags in the CDATA
structure?





--
View this message in context:
http://lucene.472066.n3.nabble.com/Solr-6-0-Highlighting-Not-Working-tp43027
87p4302835.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr 6.0 Highlighting Not Working

Posted by jimtronic <ji...@gmail.com>.
Perhaps you need to wrap your inner "<em>" and "</em>" tags in the CDATA
structure?





--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-6-0-Highlighting-Not-Working-tp4302787p4302835.html
Sent from the Solr - User mailing list archive at Nabble.com.