@Override protected NumericDocValues getKeys(LeafReaderContext context) { final SortedSetDocValues globalOrds = valuesSource.globalOrdinalsValues(context); final SortedDocValues singleValues = DocValues.unwrapSingleton(globalOrds); if (singleValues != null) {
@Override protected NumericDocValues getKeys(LeafReaderContext context) { final SortedSetDocValues globalOrds = valuesSource.globalOrdinalsValues(context); final SortedDocValues singleValues = DocValues.unwrapSingleton(globalOrds); if (singleValues != null) {
@Override protected NumericDocValues getKeys(LeafReaderContext context) { final RandomAccessOrds globalOrds = valuesSource.globalOrdinalsValues(context); final SortedDocValues singleValues = DocValues.unwrapSingleton(globalOrds); if (singleValues != null) { return new NumericDocValues() { @Override public long get(int doc) { return singleValues.getOrd(doc); } }; } return new NumericDocValues() { @Override public long get(int doc) { globalOrds.setDocument(doc); final long valuesCount = globalOrds.cardinality(); if (valuesCount > 1) { throw new IllegalArgumentException("Sample diversifying key must be a single valued-field"); } if (valuesCount == 1) { long result = globalOrds.ordAt(0); return result; } return Long.MIN_VALUE; } }; }
@Override protected NumericDocValues getKeys(LeafReaderContext context) { final RandomAccessOrds globalOrds = valuesSource.globalOrdinalsValues(context); final SortedDocValues singleValues = DocValues.unwrapSingleton(globalOrds); if (singleValues != null) { return new NumericDocValues() { @Override public long get(int doc) { return singleValues.getOrd(doc); } }; } return new NumericDocValues() { @Override public long get(int doc) { globalOrds.setDocument(doc); final long valuesCount = globalOrds.cardinality(); if (valuesCount > 1) { throw new IllegalArgumentException("Sample diversifying key must be a single valued-field"); } if (valuesCount == 1) { long result = globalOrds.ordAt(0); return result; } return Long.MIN_VALUE; } }; }
@Override protected NumericDocValues getKeys(LeafReaderContext context) { final SortedSetDocValues globalOrds = valuesSource.globalOrdinalsValues(context); final SortedDocValues singleValues = DocValues.unwrapSingleton(globalOrds); if (singleValues != null) {