Hi there!
We have an elastic mapping that looks something like:
"mappings": {
"full-text-content": {
"dynamic": "strict",
"properties": {}
"doi": {
"type": "string",
"index": "not_analyzed",
"doc_values": True
},
"customerFacetFields": {
"properties": {
"field1": {
"type": "Boolean",
"index": "not_analyzed",
"doc_values": True
},
"field2": {
"type": "string",
"index": "not_analyzed",
"doc_values": True
},
"field3": {
"type": "string",
"index": "not_analyzed",
"doc_values": True
}
}
},
"customerPassthroughFields": {
"properties": {
"passthroughfield1": {
"type": "string"
},
"passthroughfield2": {
"type": "string"
}
}
}
}
}
}
As you call tell:
- We use strict mode
- There are 2 types of fields determined by the customer, depending on if it's something we want to support facetting on or not
To enable this, we've built a kind of self-service, that allows customers to define new fields (with limitations).
However, for the passthroughFields, this is seen as a bit too much bother - really, we want them to be able to put whatever they want in there, and schema be damned. On the other hand, we really don't want them to mess with the schema of customerFacetFields.
Is there any way to tell Elastic to make the whole schema "strict" BUT allow a sub-part ("customerPassthroughFields") to be dynamic?
Thanks in advance!