mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-24 22:09:24 +00:00
Mapping: Allow to specify enabled set to false on a property without specifying the type, closes #1959.
This commit is contained in:
parent
11a1f69257
commit
07e0888b3e
@ -244,6 +244,11 @@ public class ObjectMapper implements Mapper, AllFieldMapper.IncludeInAll {
|
|||||||
type = ObjectMapper.CONTENT_TYPE;
|
type = ObjectMapper.CONTENT_TYPE;
|
||||||
} else if (propNode.get("fields") != null) {
|
} else if (propNode.get("fields") != null) {
|
||||||
type = MultiFieldMapper.CONTENT_TYPE;
|
type = MultiFieldMapper.CONTENT_TYPE;
|
||||||
|
} else if (propNode.size() == 1 && propNode.get("enabled") != null) {
|
||||||
|
// if there is a single property with the enabled flag on it, make it an object
|
||||||
|
// (usually, setting enabled to false to not index any type, including core values, which
|
||||||
|
// non enabled object type supports).
|
||||||
|
type = ObjectMapper.CONTENT_TYPE;
|
||||||
} else {
|
} else {
|
||||||
throw new MapperParsingException("No type specified for property [" + propName + "]");
|
throw new MapperParsingException("No type specified for property [" + propName + "]");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user