[highlighting] Another test for boundary chars

This commit is contained in:
Nik Everett 2016-01-06 13:42:15 -05:00
parent f5898fb07f
commit add60a7560
1 changed files with 9 additions and 0 deletions

View File

@ -851,6 +851,15 @@ public class HighlighterSearchIT extends ESIntegTestCase {
assertHighlight(searchResponse, 0, "field2", 0, 1, equalTo("The <em>quick</em> brown fox jumps over"));
logger.info("--> searching with boundary characters on the field");
source = searchSource()
.query(matchQuery("field2", "quick"))
.highlighter(highlight().field(new Field("field2").fragmentSize(30).numOfFragments(1).boundaryChars(new char[] {' '})));
searchResponse = client().prepareSearch("test").setSource(source).get();
assertHighlight(searchResponse, 0, "field2", 0, 1, equalTo("The <em>quick</em> brown fox jumps over"));
}
/**