/** * Return a {@link org.apache.lucene.search.vectorhighlight.FragmentsBuilder} appropriate for this field. * * @param params The params controlling Highlighting * @return An appropriate {@link org.apache.lucene.search.vectorhighlight.FragmentsBuilder}. */ public FragmentsBuilder getFragmentsBuilder(SolrParams params, BoundaryScanner bs) { numRequests++; params = SolrParams.wrapDefaults(params, defaults); return getFragmentsBuilder( params, getPreTags( params, null ), getPostTags( params, null ), bs ); }
@Override protected FragmentsBuilder getFragmentsBuilder( SolrParams params, String[] preTags, String[] postTags, BoundaryScanner bs ) { org.apache.lucene.search.vectorhighlight.SimpleFragmentsBuilder sfb = new org.apache.lucene.search.vectorhighlight.SimpleFragmentsBuilder( preTags, postTags, bs ); sfb.setMultiValuedSeparator( getMultiValuedSeparatorChar( params ) ); return sfb; }
@Override protected FragmentsBuilder getFragmentsBuilder( SolrParams params, String[] preTags, String[] postTags, BoundaryScanner bs ) { org.apache.lucene.search.vectorhighlight.ScoreOrderFragmentsBuilder sofb = new org.apache.lucene.search.vectorhighlight.ScoreOrderFragmentsBuilder( preTags, postTags, bs ); sofb.setMultiValuedSeparator( getMultiValuedSeparatorChar( params ) ); return sofb; }
static FastVectorHighlighter getHighlighter() { FragListBuilder fragListBuilder = new SimpleFragListBuilder(); // #F FragmentsBuilder fragmentBuilder = // #F new ScoreOrderFragmentsBuilder( // #F BaseFragmentsBuilder.COLORED_PRE_TAGS, // #F BaseFragmentsBuilder.COLORED_POST_TAGS); // #F return new FastVectorHighlighter(true, true, // #F fragListBuilder, fragmentBuilder); // #F }
protected abstract FragmentsBuilder getFragmentsBuilder( SolrParams params, String[] preTags, String[] postTags, BoundaryScanner bs );
protected FragmentsBuilder getFragmentsBuilder(String fieldName, SolrParams params) { BoundaryScanner bs = getBoundaryScanner(fieldName, params); return getSolrFragmentsBuilder(fieldName, params).getFragmentsBuilder(params, bs); }