lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pasha Bizhan" <>
Subject RE: highlight the search word
Date Sun, 15 Aug 2004 19:19:34 GMT

> From: [] 
> Hi Pasha,
> I think the advice you gave is for an earlier version.

You are right.

> With the latest version things have moved around and you 
> would have to: 
>     //use a max fragment size > size of text to ensure you 
> get all text in one fragment
>     highlighter.setTextFragmenter(SimpleFragmenter(400000));
>     // call getBestFragment....
>    String result =highlighter.getBestFragment(tokenStream,text);

Why you have not made it in one call? 

For example -
 String result = highlighter.highlightAll(tokenStream, text).

  highlighter.setTextFragmenter(new OneFragmentFragmenter());
  String result =highlighter.getBestFragment(tokenStream,text);

I ask because in your example i should calculate the size of the initial
text in any case.
I do not want to do it :) One call will allow to write more solid and dense

Pasha Bizhan

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message