It could be the "merge contiguous fragments" feature that attempts to do exactly this to improve readability

It's an option you can turn off.

On 15 Nov 2009, at 01:21, Felipe Lobo wrote:

Hi, i'm having some problems with the size of the fragmentes when i'm doing the highlight. I pass on the constructor of the SimpleSpanFragmenter a size
of 80, but i'm having some fragments of 500.
But it only happen when i do searches with 3 or more words.
What i notice is that he tries to put the highlights in the same fragments,
but makes it too big.

code:
       highlighter.setTextFragmenter(new
SimpleSpanFragmenter(scorer,FRAGMENT_SIZE));//FRAGMENT_SIZE=80

       fieldName = "Body";
       text =
CompressionTools.decompressString(result.getField (fieldName).getBinaryValue());

      tokenStream = analyzer.tokenStream(fieldName, new
StringReader(text));

       markedResult = null;

       try{
markedResult = highlighter.getBestFragments(tokenStream, text,
NUM_FRAGMENTS, TOKEN_DELIMITER).trim();// NUM_FRAGMENTS=3 and
TOKEN_DELIMITER="..."
       }
       catch (Exception ex){
           logger.error(ex.toString());
       }

i'm using brazilian analyser with lucene core 2.9.1 and highlighter and
memory 2.9.0 .

thanks.

--
Felipe Lobo
www.jusbrasil.com.br


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to