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 Jannicke Husby <ja...@acando.no> on 2016/08/22 08:14:58 UTC

Question about highlighting html-tags

Hi,


I have a question about searchterms and highlighting, hope you can help me.

The problem is that the HTML-tags get highlighted as well.


Example:

I search for "google". It hits the text "google" and that is a hyperlink like this <a href="https://www.google.com">google</a>.  I only want the text between the a-tags to get highlighted but it highlight the value in the "href"-attribute too.

I want it like this: <a href="https://www.google.com"><span class="highlight">google</span></a>
It get like this: <a href="https://www.<span class="highlight">google</span>.com"><span class="highlight">google</span></a>

So my question is: How can I prevent Solr to hits the HTML-tags in highlighted fields?



Jannicke Husby
Consultant
<ma...@acando.no>
jannicke.husby@acando.no<ma...@acando.no>
<ma...@acando.no>
Mobile: +47 950 50 682

[http://www.acando.no/Content/101276/Bilde%20signatur.png]
Acando Norge
Tordenskioldsgate 8-10
0160 Oslo
+47 93 00 10 00
www.acando.no<http://www.acando.no/>
Follow Acando
Facebook<https://www.facebook.com/AcandoNorge> Twitter<https://twitter.com/AcandoNorge> Linkedin<https://www.linkedin.com/company/abeo-as>