@Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { if (hasDocValues()) { return new DocValuesIndexFieldData.Builder(); } else { // means the index has a single type and the type field is implicit Function<MapperService, String> typeFunction = mapperService -> { Collection<String> types = mapperService.types(); if (types.size() > 1) { throw new AssertionError(); } // If we reach here, there is necessarily one type since we were able to find a `_type` field String type = types.iterator().next(); return type; }; return new ConstantIndexFieldData.Builder(typeFunction); } }
@Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { if (hasDocValues()) { return new DocValuesIndexFieldData.Builder(); } else { // means the index has a single type and the type field is implicit Function<MapperService, String> typeFunction = mapperService -> { Collection<String> types = mapperService.types(); if (types.size() > 1) { throw new AssertionError(); } // If we reach here, there is necessarily one type since we were able to find a `_type` field String type = types.iterator().next(); return type; }; return new ConstantIndexFieldData.Builder(typeFunction); } }
@Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { if (hasDocValues()) { return new DocValuesIndexFieldData.Builder(); } else { // means the index has a single type and the type field is implicit Function<MapperService, String> typeFunction = mapperService -> { Collection<String> types = mapperService.types(); if (types.size() > 1) { throw new AssertionError(); } // If we reach here, there is necessarily one type since we were able to find a `_type` field String type = types.iterator().next(); return type; }; return new ConstantIndexFieldData.Builder(typeFunction); } }
@Override public IndexFieldData.Builder fielddataBuilder() { if (hasDocValues()) { return new DocValuesIndexFieldData.Builder(); } else if (fielddata) { return new PagedBytesIndexFieldData.Builder(TextFieldMapper.Defaults.FIELDDATA_MIN_FREQUENCY, TextFieldMapper.Defaults.FIELDDATA_MAX_FREQUENCY, TextFieldMapper.Defaults.FIELDDATA_MIN_SEGMENT_SIZE); } else { // means the index has a single type and the type field is implicit Function<MapperService, String> typeFunction = mapperService -> { Collection<String> types = mapperService.types(); if (types.size() > 1) { throw new AssertionError(); } // If we reach here, there is necessarily one type since we were able to find a `_type` field String type = types.iterator().next(); return type; }; return new ConstantIndexFieldData.Builder(typeFunction); } }
@Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { return new ConstantIndexFieldData.Builder(mapperService -> fullyQualifiedIndexName); } }
@Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { return new ConstantIndexFieldData.Builder(mapperService -> fullyQualifiedIndexName); } }
@Override public IndexFieldData.Builder fielddataBuilder() { return new ConstantIndexFieldData.Builder(mapperService -> mapperService.index().getName()); } }
@Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { return new ConstantIndexFieldData.Builder(mapperService -> fullyQualifiedIndexName); } }