Add runtime_script date field#60092
Conversation
Adds support for `runtime_script` fields with `runtime_type: date`. Doesn't add support for the `format` parameter to the mapper but *does* support it on aggregations and the like. Its a start!
|
Pinging @elastic/es-search (:Search/Search) |
javanna
left a comment
There was a problem hiding this comment.
left a couple of comments, LGTM otherwise
|
|
||
| // dates and time and geo need special handling | ||
| parser.nextToken(); | ||
| // TODO these ain't gonna work with runtime fields |
There was a problem hiding this comment.
interesting scenario that I never though about: scoring based on runtime fields. You already added this to the runtime fields meta issue right?
| return Queries.newMatchNoDocsQuery("Can't run [" + NAME + "] query on unmapped fields!"); | ||
| } | ||
| Object originObj = origin.origin(); | ||
| // TODO these ain't gonna work with runtime fields |
There was a problem hiding this comment.
interesting too, at least both of these are around parsing values, which you are making public so that we can reuse for runtime fields?
There was a problem hiding this comment.
Yeah, we can handle this somehow.
| return scriptFactory.newFactory(script.getParams(), context.lookup()); | ||
| private AbstractLongScriptFieldScript.LeafFactory leafFactory(QueryShardContext context) { | ||
| LongScriptFieldScript.LeafFactory delegate = scriptFactory.newFactory(script.getParams(), context.lookup()); | ||
| return ctx -> delegate.newInstance(ctx); |
There was a problem hiding this comment.
I get confused here on what has changed. why can't we return the long field script. given that we are in the long mapped field type?
There was a problem hiding this comment.
I don't remember! I'll check.
There was a problem hiding this comment.
It had to do with being able to share the queries. I've dropped it in favor of something a little more obvious.
Adds support for
runtime_scriptfields withruntime_type: date.Doesn't add support for the
formatparameter to the mapper but doessupport it on aggregations and the like. Its a start!