@Override public int previous() { if (text.getIndex() == text.getBeginIndex()) { return DONE; } else { return advanceBackward(); } }
@Override public int next() { if (text.getIndex() == text.getEndIndex()) { return DONE; } else { return advanceForward(); } }
new org.apache.lucene.search.postingshighlight .CustomSeparatorBreakIterator(MULTIVAL_SEP_CHAR); highlighter =
CustomSeparatorBreakIterator breakIterator = new CustomSeparatorBreakIterator(HighlightUtils.NULL_SEPARATOR); highlighter = new CustomPostingsHighlighter(analyzer, mapperHighlighterEntry.passageFormatter, breakIterator, fieldValue, field.fieldOptions().noMatchSize() > 0);
CustomSeparatorBreakIterator breakIterator = new CustomSeparatorBreakIterator(HighlightUtils.NULL_SEPARATOR); highlighter = new CustomPostingsHighlighter(analyzer, mapperHighlighterEntry.passageFormatter, breakIterator, fieldValue, field.fieldOptions().noMatchSize() > 0);
@Override public int preceding(int pos) { if (pos < text.getBeginIndex() || pos > text.getEndIndex()) { throw new IllegalArgumentException("offset out of bounds"); } else if (pos == text.getBeginIndex()) { // this conflicts with the javadocs, but matches actual behavior (Oracle has a bug in something) // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=9000909 text.setIndex(text.getBeginIndex()); current = text.getIndex(); return DONE; } else { text.setIndex(pos); current = text.getIndex(); return advanceBackward(); } }
@Override public int following(int pos) { if (pos < text.getBeginIndex() || pos > text.getEndIndex()) { throw new IllegalArgumentException("offset out of bounds"); } else if (pos == text.getEndIndex()) { // this conflicts with the javadocs, but matches actual behavior (Oracle has a bug in something) // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=9000909 text.setIndex(text.getEndIndex()); current = text.getIndex(); return DONE; } else { text.setIndex(pos); current = text.getIndex(); return advanceForward(); } }