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 syoung <sy...@localmatters.com> on 2008/10/01 18:35:53 UTC

Controlling Length of Text Snippets Before and After Highlighted Term

Hi All,

I'm not sure if there is a way to do this.  I have a requirement to display
exactly 20 characters before and 20 characters after the highlighted term.

Thanks,

Susan
-- 
View this message in context: http://www.nabble.com/Controlling-Length-of-Text-Snippets-Before-and-After-Highlighted-Term-tp19764382p19764382.html
Sent from the Solr - User mailing list archive at Nabble.com.


RE: Controlling Length of Text Snippets Before and After Highlighted Term

Posted by Lance Norskog <go...@gmail.com>.
You could handle this problem with an XSL script on the output.
It would scan for the highlighting markers and munge the text. 
I've done a few things with the XsltResponseWriter and I do not envy you
this coding task :) but it is possible.


http://wiki.apache.org/solr/XsltResponseWriter

-----Original Message-----
From: Grant Ingersoll [mailto:gsingers@apache.org] 
Sent: Friday, October 03, 2008 9:05 AM
To: solr-user@lucene.apache.org
Subject: Re: Controlling Length of Text Snippets Before and After
Highlighted Term

Solr doesn't know anything about your display.
http://wiki.apache.org/solr/HighlightingParameters
  details how you can use different sized fragments for generating the
snippets, but it is still up to you as to how much you want to display.  The
two need not be related.


On Oct 1, 2008, at 12:35 PM, syoung wrote:

>
> Hi All,
>
> I'm not sure if there is a way to do this.  I have a requirement to 
> display exactly 20 characters before and 20 characters after the 
> highlighted term.
>
> Thanks,
>
> Susan
> --
> View this message in context: 
> http://www.nabble.com/Controlling-Length-of-Text-Snippets-Before-and-A
> fter-Highlighted-Term-tp19764382p19764382.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

--------------------------
Grant Ingersoll

Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ










Re: Controlling Length of Text Snippets Before and After Highlighted Term

Posted by Grant Ingersoll <gs...@apache.org>.
Solr doesn't know anything about your display.  http://wiki.apache.org/solr/HighlightingParameters 
  details how you can use different sized fragments for generating the  
snippets, but it is still up to you as to how much you want to  
display.  The two need not be related.


On Oct 1, 2008, at 12:35 PM, syoung wrote:

>
> Hi All,
>
> I'm not sure if there is a way to do this.  I have a requirement to  
> display
> exactly 20 characters before and 20 characters after the highlighted  
> term.
>
> Thanks,
>
> Susan
> -- 
> View this message in context: http://www.nabble.com/Controlling-Length-of-Text-Snippets-Before-and-After-Highlighted-Term-tp19764382p19764382.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

--------------------------
Grant Ingersoll

Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ