-
Notifications
You must be signed in to change notification settings - Fork 918
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
[Geospatial] Add new geo shape filter field to support geospatial search query #3605
[Geospatial] Add new geo shape filter field to support geospatial search query #3605
Conversation
aa02477
to
50a6879
Compare
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #3605 +/- ##
==========================================
- Coverage 66.47% 66.42% -0.06%
==========================================
Files 3209 3210 +1
Lines 61617 61625 +8
Branches 9504 9506 +2
==========================================
- Hits 40958 40932 -26
- Misses 18386 18414 +28
- Partials 2273 2279 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 6 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
c59d581
to
bb1a94c
Compare
bb1a94c
to
3c96f42
Compare
b80d682
to
243d2a6
Compare
src/plugins/data/common/opensearch_query/filters/geo_shape_filter.ts
Outdated
Show resolved
Hide resolved
src/plugins/data/common/opensearch_query/filters/geo_shape_filter.ts
Outdated
Show resolved
Hide resolved
src/plugins/data/common/opensearch_query/filters/geo_shape_filter.ts
Outdated
Show resolved
Hide resolved
be85917
to
f159296
Compare
@AMoo-Miki Can you take a look at PR one more time? Thanks. Sorry for the rush, since we will be building feature in Maps using this PR and this is blocker for our current development. |
@VijayanB for speed could you provide a screen shot or describe recreation steps how to be able to use this new functionality. |
|
||
export type GeoShapeFilter = Filter & { | ||
meta: GeoShapeFilterMeta; | ||
geo_shape: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will we consider define a more specific interface or type for the geo_shape property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
geo_shape will have dynamic field name and "ignored_unmapped" as well. I couldn't find a way to define both in same structure. Do you know how to do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite sure about what should be geo_shape, but it is similar to meta, will this work?
export type GeoShapeFilter = Filter & {
meta: GeoShapeFilterMeta;
geo_shape: {
[fieldName: string]: {
shape?: ShapeFilter;
indexed_shape?: PreIndexedShapeFilter;
relation?: GeoShapeRelation;
ignore_unmapped?: boolean;
};
};
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker. I will just approve it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here ignore_unmapped should be inside geo_shape , something like below
geo_shape: {
[fieldName: string]: {
shape?: ShapeFilter;
indexed_shape?: PreIndexedShapeFilter;
relation?: GeoShapeRelation;
},
ignore_unmapped?: boolean;
}
but typescript don't like this, since ignore_unmapped is also string and it can't differentiate whether is it part of fieldName or ignore_mapped.
src/plugins/data/common/opensearch_query/filters/geo_shape_filter.test.ts
Show resolved
Hide resolved
1fa0a8c
to
7f9f60b
Compare
Sure. geo_shape is a query type that can be used to define search query for geospatial index. Currently Region Maps and Coordinate maps uses geo_polygon query type, but, it is deprecated and not encourage any more. Hence, this PR, will understand any query with Filter of type GeoShape and can serialize into geo_shape query for search request . Maps will be using geo_shape filter instead of geo_polygon. |
7f9f60b
to
5ac7d4e
Compare
@kavilla @AMoo-Miki Can you please take a look at this PR? |
Add new filter query, 'geo_shape' to search geospatial field types . This new filter query will replace geo_polygon query later. With this fiter, dashboard can perform spatial relationssips with shape or predefined shape from an index against an index. Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
145edc8
to
704c109
Compare
Add new filter query, 'geo_shape' to search geospatial field types . This new filter query will replace geo_polygon query later. With this fiter, dashboard can perform spatial relationssips with shape or predefined shape from an index against an index. Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com> (cherry picked from commit 71eb3f2) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
… geospatial search query (#3681) * Add geo shape filter field to supported filter formats (#3605) Add new filter query, 'geo_shape' to search geospatial field types . This new filter query will replace geo_polygon query later. With this fiter, dashboard can perform spatial relationssips with shape or predefined shape from an index against an index. Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com> (cherry picked from commit 71eb3f2) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Josh Romero <rmerqg@amazon.com> Co-authored-by: Anan Zhuang <ananzh@amazon.com>
…oject#3605) Add new filter query, 'geo_shape' to search geospatial field types . This new filter query will replace geo_polygon query later. With this fiter, dashboard can perform spatial relationssips with shape or predefined shape from an index against an index. Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
…oject#3605) Add new filter query, 'geo_shape' to search geospatial field types . This new filter query will replace geo_polygon query later. With this fiter, dashboard can perform spatial relationssips with shape or predefined shape from an index against an index. Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com> Signed-off-by: David Sinclair <david@sinclair.tech>
Description
Add new filter query, 'geo_shape' to search geospatial field types . This is required as part of Maps plugin which
uses geo_shape filter query to search documents.
Issues Resolved
opensearch-project/dashboards-maps#213
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr