In Highlightrer, there is a Nullfragmenter. There is a requirement its counterpart in FastVectorhighlighter.
FastVectorHighlighter: add wrapper class for Lucene's SingleFragListBuilder
I implemented SingleFragListBuilder that generates one WeightedFragInfo object. Using both this class and SimpleFragmentsBuilder, you can get an entire field contents as described in Javadoc.
FastVectorHighlighter h = new FastVectorHighlighter( true, true,
new SingleFragListBuilder(), new SimpleFragmentsBuilder() );
SingleFragListBuilder ignores fragCharSize... I think createFieldFragList() shouldn't take fragCharSize argument (the necessity of fragCharSize depends on FragListBuilder impl). I want to change the interface in the future.
I think this is ready to commit. Will commit shortly.
trunk: Committed revision 960611.
branch_3x: Committed revision 960615.
I found that even if the SingleFragListBuilder is used then client has explicitly ensure that numberOfFragments > 0 otherwise highlighter produces empty output.
The thing is that
FastVectorHighlighter.getBestFragments( final FieldQuery fieldQuery, IndexReader reader, int docId, String fieldName, int fragCharSize, int maxNumFragments );
BaseFragmentsBuilder.createFragments( IndexReader reader, int docId, String fieldName, FieldFragList fieldFragList, int maxNumFragments, String preTags, String postTags, Encoder encoder);
which needs to be passed maxNumFragments > 0 in order to produce any non-empty output.
Bulk close for 3.1
Related to : SOLR-2998
Standard highlighter would, specifically LuceneGapFragmenter, only return a single highlighted value from mutlivalue field highlighting. I can't see how to get the same response from FVH, it seems to insist on concatenating all values of a multivalue field together (or at least surrounding values on highlight matches.