Replies: 1 comment 1 reply
-
Not exactly. You can't change the parent of an object like this. However, Pkl has the concept of mixins, which is meant for something like this. It lets you define an amends without knowing what the parent is. hidden frenchAnalyzer: Mixin = new {
analyzer = "french"
}
hidden lowercase: Mixin = new {
filter = "lowercase"
}
field = elastic.Text
|> frenchAnalyzer
|> lowercase A mixin is just a function, by the way. This code: hidden frenchAnalyzer: Mixin = new {
analyzer = "french"
} Is identical to this: hidden frenchAnalyzer: Mixin = (it) -> it {
analyzer = "french"
} Also, the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now I see I can do:
But is there a way to have those amends also be behind names so I could do:
My attempts so far seem to indicate this doesn't work but I might be missing some syntax that would enable this
Beta Was this translation helpful? Give feedback.
All reactions