private ValuesSource bytesField(ValuesSourceConfig<?> config) throws IOException { final IndexFieldData<?> indexFieldData = config.fieldContext.indexFieldData(); ValuesSource dataSource; if (indexFieldData instanceof ParentChildIndexFieldData) { dataSource = new ValuesSource.Bytes.WithOrdinals.ParentChild((ParentChildIndexFieldData) indexFieldData); } else if (indexFieldData instanceof IndexOrdinalsFieldData) { dataSource = new ValuesSource.Bytes.WithOrdinals.FieldData((IndexOrdinalsFieldData) indexFieldData); } else { dataSource = new ValuesSource.Bytes.FieldData(indexFieldData); } if (config.script != null) { dataSource = new ValuesSource.WithScript(dataSource, config.script); } return dataSource; }
@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; } }; }
private ValuesSource bytesField() throws IOException { final IndexFieldData<?> indexFieldData = fieldContext().indexFieldData(); ValuesSource dataSource; if (indexFieldData instanceof IndexOrdinalsFieldData) { dataSource = new ValuesSource.Bytes.WithOrdinals.FieldData((IndexOrdinalsFieldData) indexFieldData); } else { dataSource = new ValuesSource.Bytes.FieldData(indexFieldData); } if (script() != null) { dataSource = new ValuesSource.WithScript(dataSource, script()); } return dataSource; }
private ValuesSource bytesField() throws IOException { final IndexFieldData<?> indexFieldData = fieldContext().indexFieldData(); ValuesSource dataSource; if (indexFieldData instanceof IndexOrdinalsFieldData) { dataSource = new ValuesSource.Bytes.WithOrdinals.FieldData((IndexOrdinalsFieldData) indexFieldData); } else { dataSource = new ValuesSource.Bytes.FieldData(indexFieldData); } if (script() != null) { dataSource = new ValuesSource.WithScript(dataSource, script()); } return dataSource; }
private ValuesSource bytesField() throws IOException { final IndexFieldData<?> indexFieldData = fieldContext().indexFieldData(); ValuesSource dataSource; if (indexFieldData instanceof IndexOrdinalsFieldData) { dataSource = new ValuesSource.Bytes.WithOrdinals.FieldData((IndexOrdinalsFieldData) indexFieldData); } else { dataSource = new ValuesSource.Bytes.FieldData(indexFieldData); } if (script() != null) { dataSource = new ValuesSource.WithScript(dataSource, script()); } return dataSource; }
@Override protected NumericDocValues getKeys(LeafReaderContext context) { final SortedSetDocValues globalOrds = valuesSource.globalOrdinalsValues(context); final SortedDocValues singleValues = DocValues.unwrapSingleton(globalOrds); if (singleValues != null) {
private ValuesSource bytesField() throws IOException { final IndexFieldData<?> indexFieldData = fieldContext().indexFieldData(); ValuesSource dataSource; if (indexFieldData instanceof IndexOrdinalsFieldData) { dataSource = new ValuesSource.Bytes.WithOrdinals.FieldData((IndexOrdinalsFieldData) indexFieldData); } else { dataSource = new ValuesSource.Bytes.FieldData(indexFieldData); } if (script() != null) { dataSource = new ValuesSource.WithScript(dataSource, script()); } return dataSource; }