use of org.apache.lucene.index.MultiTerms in project neo4j by neo4j.
the class PartitionedUniquenessVerifier method termsForField.
private Terms termsForField(String fieldName) throws IOException {
List<Terms> terms = new ArrayList<>();
List<ReaderSlice> readerSlices = new ArrayList<>();
List<LeafReader> leafReaders = allLeafReaders();
for (LeafReader leafReader : leafReaders) {
Terms leafTerms = leafReader.terms(fieldName);
if (leafTerms != null) {
ReaderSlice readerSlice = new ReaderSlice(0, Math.toIntExact(leafTerms.size()), 0);
terms.add(leafTerms);
readerSlices.add(readerSlice);
}
}
Terms[] termsArray = terms.toArray(new Terms[0]);
ReaderSlice[] readerSlicesArray = readerSlices.toArray(new ReaderSlice[0]);
return new MultiTerms(termsArray, readerSlicesArray);
}
Aggregations