source.close();
} catch (IOException e) {
// ignore
}
if (multipleTokens) {
throw new ParseException("Cannot build RangeQuery with analyzer " + getAnalyzer().getClass()
+ " - tokens were added to part1");
}
// part2
source = getAnalyzer().tokenStream(field, new StringReader(part2));
termAtt = (TermAttribute) source.addAttribute(TermAttribute.class);
try {
if (source.incrementToken()) {
part2 = termAtt.term();
}
multipleTokens = source.incrementToken();
} catch (IOException e) {
// ignore
}
try {
source.close();
} catch (IOException e) {
// ignore
}
if (multipleTokens) {
throw new ParseException("Cannot build RangeQuery with analyzer " + getAnalyzer().getClass()
+ " - tokens were added to part2");
}
return super.getRangeQuery(field, part1, part2, inclusive);
}