@Override protected AcceptStatus accept(BytesRef arg0) throws IOException { int docFreq = docFreq(); if (docFreq >= minFreq && docFreq <= maxFreq) { return AcceptStatus.YES; } return AcceptStatus.NO; } }
@Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { return new ConstantIndexFieldData.Builder(mapperService -> fullyQualifiedIndexName); } }
@Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { return new DocValuesIndexFieldData.Builder(); } }
@Override public AtomicNumericFieldData load(LeafReaderContext context) { final LeafReader reader = context.reader(); final String field = fieldName; switch (numericType) { case HALF_FLOAT: return new SortedNumericHalfFloatFieldData(reader, field); case FLOAT: return new SortedNumericFloatFieldData(reader, field); case DOUBLE: return new SortedNumericDoubleFieldData(reader, field); default: return new SortedNumericLongFieldData(reader, field, numericType); } }
@Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { failIfNoDocValues(); return new DocValuesIndexFieldData.Builder().numericType(NumericType.BOOLEAN); }
@Override public IndexFieldData<?> build(IndexSettings indexSettings, MappedFieldType fieldType, IndexFieldDataCache cache, CircuitBreakerService breakerService, MapperService mapperService) { // Ignore Circuit Breaker final String fieldName = fieldType.name(); if (BINARY_INDEX_FIELD_NAMES.contains(fieldName)) { assert numericType == null; return new BinaryDVIndexFieldData(indexSettings.getIndex(), fieldName); } else if (numericType != null) { return new SortedNumericDVIndexFieldData(indexSettings.getIndex(), fieldName, numericType); } else { return new SortedSetDVOrdinalsIndexFieldData(indexSettings, cache, fieldName, breakerService, scriptFunction); } }
@Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { failIfNoDocValues(); return new DocValuesIndexFieldData.Builder().scriptFunction(IpScriptDocValues::new); }
@Override public AtomicGeoPointFieldData load(LeafReaderContext context) { LeafReader reader = context.reader(); FieldInfo info = reader.getFieldInfos().fieldInfo(fieldName); if (info != null) { checkCompatible(info); } return new LatLonPointDVAtomicFieldData(reader, fieldName); }
@Override public AtomicNumericFieldData loadDirect(LeafReaderContext context) throws Exception { return load(context); }
@Override public BytesBinaryDVAtomicFieldData loadDirect(LeafReaderContext context) throws Exception { return load(context); }
@Override public BinaryDVAtomicFieldData loadDirect(LeafReaderContext context) throws Exception { return load(context); }
@Override protected AtomicOrdinalsFieldData empty(int maxDoc) { return AbstractAtomicOrdinalsFieldData.empty(); }
@Override public AtomicOrdinalsFieldData loadDirect(LeafReaderContext context) throws Exception { return load(context); }
@Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { failIfNoDocValues(); return new BytesBinaryDVIndexFieldData.Builder(); }
private ConstantIndexFieldData(IndexSettings indexSettings, String name, String value) { super(indexSettings, name, null, null, TextFieldMapper.Defaults.FIELDDATA_MIN_FREQUENCY, TextFieldMapper.Defaults.FIELDDATA_MAX_FREQUENCY, TextFieldMapper.Defaults.FIELDDATA_MIN_SEGMENT_SIZE); atomicFieldData = new ConstantAtomicFieldData(value); }
@Override public IndexOrdinalsFieldData localGlobalDirect(DirectoryReader indexReader) throws Exception { return loadGlobal(indexReader); }
@Override public AtomicGeoPointFieldData loadDirect(LeafReaderContext context) throws Exception { return load(context); }
@Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { failIfNoDocValues(); return new AbstractLatLonPointDVIndexFieldData.Builder(); }
@Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { failIfNoDocValues(); return new DocValuesIndexFieldData.Builder().numericType(NumericType.LONG); }
@Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { failIfNoDocValues(); return new DocValuesIndexFieldData.Builder(); }