You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by ruchi thakur <ru...@gmail.com> on 2007/03/11 14:10:47 UTC

ensuring search String availability in the content returned by lucene

Am using lucene search. I have a field as "summary" in my Document, which is
having large amount of content/data. In each search i want to get not more
than 200 words from the field "summary". Now i want that in the 200 words
that i get, there should be search String available. If this possible in
lucene search to get the relevant search result having search String.
Thanks and Regards,
Ruchika

Re: ensuring search String availability in the content returned by lucene

Posted by Lukas Vlcek <lu...@gmail.com>.
Hi,

I am not sure if I can help you a lot but you can check how Nutch does this
(although it does not do exactly what you want). See

*org.apache.nutch.summary.basic.BasicSummarizer
*

or

*org.apache.nutch.summary.lucene.LuceneSummarizer*

You should also check Highliter API (
http://lucene.apache.org/java/docs/api/org/apache/lucene/search/highlight/Highlighter.html#getBestFragment(org.apache.lucene.analysis.TokenStream,%20java.lang.String)<http://lucene.apache.org/java/docs/api/org/apache/lucene/search/highlight/Highlighter.html#getBestFragment%28org.apache.lucene.analysis.TokenStream,%20java.lang.String%29>
)

Regards,
Lukas


On 3/11/07, ruchi thakur <ru...@gmail.com> wrote:
>
> Am using lucene search. I have a field as "summary" in my Document, which
> is
> having large amount of content/data. In each search i want to get not more
> than 200 words from the field "summary". Now i want that in the 200 words
> that i get, there should be search String available. If this possible in
> lucene search to get the relevant search result having search String.
> Thanks and Regards,
> Ruchika
>