You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have (rather big) documents that can have many sub-attributes which are updated frequently. These attributes are kept as child documents, with the big document as the parent.
The parent document can have arbitrary type, and those types are dynamic and can be created on the fly.
The child type has a common structure - _attr (so for example for parent "book" the child type will be "book_attr").
I want to be able to have a template that automatically defines the right parent mapping on the child type.
So I need to be able to set a template that uses regex and not wildcard on the name and allows using captures from it in the mapping definition. so it will be something like -
#2. I"d like to be able to define the index names the template works for as a regex and not a wildcard, and to be able to use capture groups from the regex inside the template definition. So, in my example, you can assign a template to catch specific format of index names, and automatically create a child type where the parent is derived from the captured index name.
i'm -1 on this. It just introduces a level of complexity that i'm uncomfortable with, plus it is not bwc. Currently we allow simple patterns (ie shell globbing). We can't support those and regexes in the same place without having some flag... ie more complexity.
Elasticsearch should support common use cases simply, and allow more complex stuff to be done via the app. I don't think the API should be bent to support corner cases, as it makes it more complex (and likely buggier) for everybody.
The use case is this -
I have (rather big) documents that can have many sub-attributes which are updated frequently. These attributes are kept as child documents, with the big document as the parent.
The parent document can have arbitrary type, and those types are dynamic and can be created on the fly.
The child type has a common structure - _attr (so for example for parent "book" the child type will be "book_attr").
I want to be able to have a template that automatically defines the right parent mapping on the child type.
So I need to be able to set a template that uses regex and not wildcard on the name and allows using captures from it in the mapping definition. so it will be something like -
{
"template" : "(.*)_attr",
"settings" : {
"number_of_shards" : 1
},
"mappings" : {
"attributes" : {
"_parent" : {
"type" : "{0}"
}
}
}
}
The text was updated successfully, but these errors were encountered: