MetadataFieldMapper.Builder.build() doesn't need ContentPath (#64636)

Metadata fields are always instantiated at the root of a document,
so they don't need to take the ContentPath in their build() methods.

Also converts a couple of metadata parsers from Configurable to
Fixed, as they don't have any parameters.
This commit is contained in:
Alan Woodward 2020-11-05 15:34:52 +00:00 committed by GitHub
parent bd4703250f
commit 61b51ba822
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 15 additions and 91 deletions

View file

@ -20,7 +20,6 @@
package org.elasticsearch.index.mapper.size;
import org.elasticsearch.common.Explicit;
import org.elasticsearch.index.mapper.ContentPath;
import org.elasticsearch.index.mapper.FieldMapper;
import org.elasticsearch.index.mapper.MappedFieldType;
import org.elasticsearch.index.mapper.MetadataFieldMapper;
@ -53,7 +52,7 @@ public class SizeFieldMapper extends MetadataFieldMapper {
}
@Override
public SizeFieldMapper build(ContentPath contentPath) {
public SizeFieldMapper build() {
return new SizeFieldMapper(enabled.getValue(), new NumberFieldType(NAME, NumberType.INTEGER));
}
}