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 Vignesh Raj <vi...@greatminds.co.in> on 2011/05/24 13:08:19 UTC

Highlighting in solr

Hi,

I use Solrnet to develop a search engine. In my application, I have a field
called file_contents which I use for highlighting. Am able to get the
highlights without a problem. Now I need to format it. For example, if the
keyword occurs multiple times in the field, I have to display it lime what
google does. May be like this.

GSMArena.com: Toshiba GSM cellphones. ... Toshiba phones. Toshiba. Filters.
Available . Coming soon . Smartphone . Touchscreen . Camera . Bluetooth .
Wi-Fi ...

Multiple snippets here are separated by "...". 

I need to achieve something like this. Am able to get multiple snippets. But
how do I deal with the separating?

Regards

Vignesh

 


Re: Highlighting in solr

Posted by Darren Govoni <da...@ontrenet.com>.
You should be able to retrieve the snippets in your search engine and
combine or format
them however you like before returning the results to your client Right?

So in your middle tier, you invoke solr with a search, get the results,
retrieve the snippets,
iterate over them and format to your needs, then return it. That's
basically what I do for mine.


On Tue, 2011-05-24 at 16:38 +0530, Vignesh Raj wrote:

> Hi,
> 
> I use Solrnet to develop a search engine. In my application, I have a field
> called file_contents which I use for highlighting. Am able to get the
> highlights without a problem. Now I need to format it. For example, if the
> keyword occurs multiple times in the field, I have to display it lime what
> google does. May be like this.
> 
> GSMArena.com: Toshiba GSM cellphones. ... Toshiba phones. Toshiba. Filters.
> Available . Coming soon . Smartphone . Touchscreen . Camera . Bluetooth .
> Wi-Fi ...
> 
> Multiple snippets here are separated by "...". 
> 
> I need to achieve something like this. Am able to get multiple snippets. But
> how do I deal with the separating?
> 
> Regards
> 
> Vignesh
> 
>  
>