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 · 0 comments
Open

always getting Infinity in geo_distance sorting #2364

SirCameron opened this issue Sep 12, 2024 · 0 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?

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

1 participant