lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Klaas <>
Subject Re: highlighting and hyperlink
Date Fri, 30 May 2008 21:34:13 GMT

On 30-May-08, at 2:25 PM, Kevin Xiao wrote:

> Hi
> I am not sure if there are any discussions about this, I could not  
> find the search function in mailing list archives. :) Anyway, here  
> is my problem:
> In my document, I have a hyperlink, say, <a href="../home/home.nb? 
> q=breast+cancer">breast cancer</a>, but when I applied solr  
> highlighting on search term 'cancer', that hyperlink becomes: <a  
> href="../home/home.nb?q=breast+<span class="TermHighlight">cancer</ 
> span>">breast <span class="TermHighlight">cancer</span></a>.
> Obviously I don't want highlighting the first cancer (in red).
> Is there a flag to turn that off, or I have to write something  
> myself without using solr highlighting feature?

No, Solr has no idea that you are highlighting html text.  The best  
thing to do would be to use a tokenizer that doesn't generate terms  
for urls inside the href of anchor tags (this will also produce the  
nice result of not matching keywords inside hidden urls).


View raw message