queryString = buf.toString();
} else {
throw new RuntimeException("Unexpected IndexRanges implementation");
}
} else {
RangeCalculator calc = this.getTermIndexInformation(connector, auths, indexedTerms, terms, this.getIndexTableName(), this.getReverseIndexTableName(),
queryString, this.queryThreads, typeFilter);
if (null == calc.getResult() || calc.getResult().isEmpty()) {
// Then we didn't find anything in the index for this query. This may happen for an indexed term that has wildcards
// in unhandled locations.
// Break out of here by throwing a named exception and do full scan
throw new DoNotPerformOptimizedQueryException();
}
termIndexInfo = new UnionIndexRanges();
termIndexInfo.setIndexValuesToOriginalValues(calc.getIndexValues());
termIndexInfo.setFieldNamesAndValues(calc.getIndexEntries());
termIndexInfo.getTermCardinality().putAll(calc.getTermCardinalities());
for (Range r : calc.getResult()) {
// foo is a placeholder and is ignored.
termIndexInfo.add("foo", r);
}
}
} catch (TableNotFoundException e) {