lucene-java-user mailing list archives

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

> From: markharw00d@yahoo.co.uk [mailto:markharw00d@yahoo.co.uk] 
> 
> 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).

Or:
  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
code. 


Pasha Bizhan
http://lucenedotnet.com


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message