protected Term parseFullTextSearchExpression( String expression, Position startOfExpression ) { try { return new FullTextSearchParser().parse(expression); } catch (ParsingException e) { // Convert the position in the exception into a position in the query. Position queryPos = startOfExpression.add(e.getPosition()); throw new ParsingException(queryPos, e.getMessage()); } }
protected Term parseFullTextSearchExpression( String expression, Position startOfExpression ) { try { return new FullTextSearchParser().parse(expression); } catch (ParsingException e) { // Convert the position in the exception into a position in the query. Position queryPos = startOfExpression.add(e.getPosition()); throw new ParsingException(queryPos, e.getMessage()); } }
protected Term parseFullTextSearchExpression( String expression, Position startOfExpression ) { try { return new FullTextSearchParser().parse(expression); } catch (ParsingException e) { // Convert the position in the exception into a position in the query. Position queryPos = startOfExpression.add(e.getPosition()); throw new ParsingException(queryPos, e.getMessage()); } }
private int combinedIndex( int firstIndex, int secondIndex ) { Position first = new Position(firstIndex, 1, 0); Position second = new Position(secondIndex, 1, 0); int firstPlusSecond = first.add(second).getIndexInContent(); int secondPlusFirst = second.add(first).getIndexInContent(); assertThat(firstPlusSecond, is(secondPlusFirst)); return firstPlusSecond; }