mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
Rename Mapper#name to Mapper#fullPath (#110040)
This addresses a long standing TODO that caused quite a few bugs over time, in that the mapper name does not include its full path, while the MappedFieldType name does. We have renamed Mapper.Builder#name to leafName (#109971) and Mapper#simpleName to leafName (#110030). This commit renames Mapper#name to fullPath for clarity This required some adjustments in FieldAliasMapper to avoid confusion between the existing path method and fullPath. I renamed path to targetPath for clarity. ObjectMapper already had a fullPath method that returned name, and was effectively a copy of name, so it could be removed.
This commit is contained in:
parent
b0d9f95e53
commit
915e4a50c5
71 changed files with 354 additions and 312 deletions
|
@ -580,11 +580,11 @@ public class AnnotatedTextFieldMapper extends FieldMapper {
|
|||
public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() {
|
||||
if (copyTo.copyToFields().isEmpty() != true) {
|
||||
throw new IllegalArgumentException(
|
||||
"field [" + name() + "] of type [" + typeName() + "] doesn't support synthetic source because it declares copy_to"
|
||||
"field [" + fullPath() + "] of type [" + typeName() + "] doesn't support synthetic source because it declares copy_to"
|
||||
);
|
||||
}
|
||||
if (fieldType.stored()) {
|
||||
return new StringStoredFieldFieldLoader(name(), leafName(), null) {
|
||||
return new StringStoredFieldFieldLoader(fullPath(), leafName(), null) {
|
||||
@Override
|
||||
protected void write(XContentBuilder b, Object value) throws IOException {
|
||||
b.value((String) value);
|
||||
|
@ -602,7 +602,7 @@ public class AnnotatedTextFieldMapper extends FieldMapper {
|
|||
Locale.ROOT,
|
||||
"field [%s] of type [%s] doesn't support synthetic source unless it is stored or has a sub-field of"
|
||||
+ " type [keyword] with doc values or stored and without a normalizer",
|
||||
name(),
|
||||
fullPath(),
|
||||
typeName()
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue