hack to work around complete text highlighting

This commit is contained in:
kimchy 2010-09-07 01:28:30 +03:00
parent bbb2033d3b
commit 2cb45d4fe7
1 changed files with 2 additions and 0 deletions

View File

@ -98,6 +98,8 @@ public class HighlightPhase implements SearchPhase {
if (field.numberOfFragments() == 0) { if (field.numberOfFragments() == 0) {
fragListBuilder = new SingleFragListBuilder(); fragListBuilder = new SingleFragListBuilder();
fragmentsBuilder = new SimpleFragmentsBuilder(field.preTags(), field.postTags()); fragmentsBuilder = new SimpleFragmentsBuilder(field.preTags(), field.postTags());
// a HACK to make highlighter do highlighting, even though its using the single frag list builder
field.numberOfFragments(1);
} else { } else {
fragListBuilder = new SimpleFragListBuilder(); fragListBuilder = new SimpleFragListBuilder();
if (field.scoreOrdered()) { if (field.scoreOrdered()) {