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

GeoDistance sort with nested field #1031

Open
aniskaziahmed opened this issue Jun 17, 2024 · 1 comment
Open

GeoDistance sort with nested field #1031

aniskaziahmed opened this issue Jun 17, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@aniskaziahmed
Copy link

Is your feature request related to a problem?

I am trying to sort the data using geo distance but the field is nested so I was trying provide a nested path but it seems there is no option available for that or it's clearly not visible/well documented how to do that.

What solution would you like?

A simple and easy way to add a nested path as we have that Sort Field

What alternatives have you considered?

I'd have to do the sorting in java unfortunately

This is the query that I have to build using java :
`
GET /test/_search
{
"sort" : [
{
"_geo_distance" : {
"event_date.location.geo_coordinates": {
"lat": 48.5073,
"lon": 12.1601
},
//THIS IS MISSING
"nested_path": "event_date",

              "order" : "desc",
              "unit" : "km",
              "mode" : "max",
              "distance_type" : "arc"
        }
    }
],

"query": {
"match_all": {
}
}
}

`

@aniskaziahmed aniskaziahmed added enhancement New feature or request untriaged labels Jun 17, 2024
@dblock
Copy link
Member

dblock commented Jun 18, 2024

Looks like this is simply missing.

FYI, we have recently merged a beginning of a code generator that aims to resolve this entire class of problems (#366). There are a few things you can do to help:

  1. Ensure that the specification for these APIs in https://github.com/opensearch-project/opensearch-api-specification is correct, and add tests for them in that repo.
  2. Write tests in this repo for the scenarios that are broken like the ones you're reporting and manually fix any of these bugs.

The combination will ensure that as we switch to the generator we're not introducing regressions.

@dblock dblock removed the untriaged label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants