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

always getting Infinity in geo_distance sorting #2364

Open
SirCameron opened this issue Sep 12, 2024 · 2 comments
Open

always getting Infinity in geo_distance sorting #2364

SirCameron opened this issue Sep 12, 2024 · 2 comments

Comments

@SirCameron
Copy link

SirCameron commented Sep 12, 2024

Question

I have an index:

{
      index: 'discoveries',
      mappings: {
        properties: {
          id: { type: 'integer' },
          description: { type: 'text' },
          location: { type: 'geo_point' },
        },
      },
    }

when I run a query like this:

      index: 'discoveries',
      query: {
        match: {
          description: {
            query: 'some text',
          },
        },
      },
      sort: [
        {
          _geo_distance: {
            location: [location.longitude, location.latitude],
            order: 'desc',
            unit: 'km',
            mode: 'median',
            distance_type: 'arc',
            ignore_unmapped: true,
          },
        },
      ],
    }

This always returns Infinity for the _geo_distance sort... always...
Has anyone else experienced this? is there something obvious I'm missing?

@JoshMock
Copy link
Member

What is the raw JSON response you get for this query if you run it via curl or in the Kibana dev console?

Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove the stale label, or leave a comment, or this will be closed in 14 days.

@github-actions github-actions bot added the stale label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants