-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Labels
IndexingIndexing, Bulk Indexing and anything related to indexingIndexing, Bulk Indexing and anything related to indexingdiscussIssues intended to help drive brainstorming and decision makingIssues intended to help drive brainstorming and decision makingenhancementEnhancement or improvement to existing feature or requestEnhancement or improvement to existing feature or request
Description
Is your feature request related to a problem? Please describe
Not all fields field types allow meta data, for example:
"mappings": {
"properties": {
"my_flat_object": {
"type": "flat_object",
"meta": { // meta is not supported
"this": "is not allowd"
}
},
"my_text": {
"type": "text",
"meta": { // meta is supported
"this": "is allowed"
}
}
},This is inconsistent and might confuse the user.
The issue discovered during #19884
Describe the solution you'd like
Extract parsing of the meta block to Base Mapper/Parser class and make parseMeta method final to ensure the consistency across all field types.
Such approach will enforce:
- the
metablock to be exclusively field related (independent of the type) - the
metablock is identified exactly the same across all the fields - Validated of the meta block is the same
- reduces the usage of Magic values for string (no repeated "meta" String)
We may introduce simple OpenSearchNames class with all necessary String names:
example:
// OpenSearchNames.java
public class OpenSearchNames {
private OpenSearchNames(){} // no constructors
public static final String META = "meta";
public static final String ID = "_id";
public static final String DOC = "_doc";
// ....
}The util class may grow slowly eradicating the Magic values in the code
Related component
No response
Describe alternatives you've considered
No response
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
IndexingIndexing, Bulk Indexing and anything related to indexingIndexing, Bulk Indexing and anything related to indexingdiscussIssues intended to help drive brainstorming and decision makingIssues intended to help drive brainstorming and decision makingenhancementEnhancement or improvement to existing feature or requestEnhancement or improvement to existing feature or request