Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add geo_grid query type #2166

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

add geo_grid query type #2166

wants to merge 1 commit into from

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Jun 30, 2023

Add types for Geo-grid query

Copy link
Member

@swallez swallez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be represented in a different way. AdditionalProperty is used to represent an additional property with an unknown name can is added on top of those already defined in the class.

Here the field name is in the object that wraps the geo information. So this is similar to most queries, that are represented as "foo"?: SingleKeyDictionary<Field, FooQuery> in the QueryContainer class. Existing geo queries are kind of snowflakes in this regard and use a different nesting structure to define the target field.

So this should be something like:

/** @variants container */
class GeoGridQuery {
    geogrid?: GeoTile,
    geohash?: GeoHash,
    geohex?: GeoHexCell,
}

The @variants annotation indicates that only one of the fields can exist at a time.

And then we need to add this to Query:

geo_grid?: SingleKeyDictionary<Field, GeoGridQuery>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants