elastic / elasticsearch-specification

Elasticsearch full specification
Apache License 2.0
111 stars 68 forks source link

Correctly mapping complex shortcuts #2713

Closed l-trotta closed 1 week ago

l-trotta commented 3 weeks ago

Currently, shortcuts only work when the alternative syntax holds a string value, for example TermQuery. We found out that there are some requests with more complex shortcuts that allow to "skip" a level of the structure, for example:

Currently the java generator has no way of supporting the deserialization of these complex shortcut, not sure about the other clients. We can start by adding the correct shortcut annotation to these classes, but we should also make sure that we actually support it.

Anaethelion commented 3 weeks ago

Settings @shortcut_propery works for me on RankEvalQuery as a shortcut to Query. @flobernd, @JoshMock does adding this works for you ?

flobernd commented 3 weeks ago

The .NET generator currently ignores shortcut properties completely. Feel free to add it here 🙂 I have to come up with a strategy to detect these cases when I work on supporting the shortcuts.

JoshMock commented 2 weeks ago

@Anaethelion I believe this should work for JS as well. :+1: