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