Search in sources :

Example 1 with FieldHighlighter

use of org.apache.lucene.search.uhighlight.FieldHighlighter in project lucene-solr by apache.

the class TestUnifiedHighlighterExtensibility method testFieldHiglighterExtensibility.

@Test
public void testFieldHiglighterExtensibility() {
    final String fieldName = "fieldName";
    FieldHighlighter fieldHighlighter = new FieldHighlighter(fieldName, null, null, null, 1, 1, null) {

        @Override
        protected Passage[] highlightOffsetsEnums(List<OffsetsEnum> offsetsEnums) throws IOException {
            return super.highlightOffsetsEnums(offsetsEnums);
        }
    };
    assertEquals(fieldHighlighter.getField(), fieldName);
}
Also used : List(java.util.List) FieldHighlighter(org.apache.lucene.search.uhighlight.FieldHighlighter) Passage(org.apache.lucene.search.uhighlight.Passage) Test(org.junit.Test)

Aggregations

List (java.util.List)1 FieldHighlighter (org.apache.lucene.search.uhighlight.FieldHighlighter)1 Passage (org.apache.lucene.search.uhighlight.Passage)1 Test (org.junit.Test)1