Skip to content

Check field data type before casting when applying geo distance sort - #130924

Merged
javanna merged 7 commits into
elastic:mainfrom
javanna:fix/geo_distance_sort_double
Jul 10, 2025
Merged

javanna merged 7 commits into
elastic:mainfrom
javanna:fix/geo_distance_sort_double

Conversation

@javanna

@javanna javanna commented Jul 9, 2025

Copy link
Copy Markdown
Contributor

If a user tries to apply geo distance sorting to a field of the wrong type, they'll get a 500 error that causes shard failures, because the field data impl gets casted to the expected type without first checking that the field type is the one expected. This commit addresses that by returning a 400 error instead.

Closes #129500

If a user tries to apply geo distance sorting to a field of the wrong type, they'll get
a 500 error that causes shard failures, because the field data impl gets casted to the
expected type without first checking that the field type is the one expected.
This commit addresses that by returning a 400 error instead.

Closes elastic#129500
@javanna
javanna requested a review from smalyshev July 9, 2025 13:37
@elasticsearchmachine elasticsearchmachine added v9.2.0 Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch labels Jul 9, 2025
@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Hi @javanna, I've created a changelog YAML for you.

@javanna javanna added the auto-backport Automatically create backport pull requests when merged label Jul 10, 2025

@andreidan andreidan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks for fixing this Luca

@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

💚 Backport successful

Status Branch Result
✅ 9.0
✅ 9.1
✅ 8.19
✅ 8.18

javanna added a commit to javanna/elasticsearch that referenced this pull request Jul 10, 2025
…lastic#130924)

If a user tries to apply geo distance sorting to a field of the wrong type, they'll get
a 500 error that causes shard failures, because the field data impl gets casted to the
expected type without first checking that the field type is the one expected.
This commit addresses that by returning a 400 error instead.

Closes elastic#129500
javanna added a commit to javanna/elasticsearch that referenced this pull request Jul 10, 2025
…lastic#130924)

If a user tries to apply geo distance sorting to a field of the wrong type, they'll get
a 500 error that causes shard failures, because the field data impl gets casted to the
expected type without first checking that the field type is the one expected.
This commit addresses that by returning a 400 error instead.

Closes elastic#129500
javanna added a commit to javanna/elasticsearch that referenced this pull request Jul 10, 2025
…lastic#130924)

If a user tries to apply geo distance sorting to a field of the wrong type, they'll get
a 500 error that causes shard failures, because the field data impl gets casted to the
expected type without first checking that the field type is the one expected.
This commit addresses that by returning a 400 error instead.

Closes elastic#129500
elasticsearchmachine pushed a commit that referenced this pull request Jul 10, 2025
…130924) (#131019)

If a user tries to apply geo distance sorting to a field of the wrong type, they'll get
a 500 error that causes shard failures, because the field data impl gets casted to the
expected type without first checking that the field type is the one expected.
This commit addresses that by returning a 400 error instead.

Closes #129500
elasticsearchmachine pushed a commit that referenced this pull request Jul 10, 2025
…130924) (#131017)

If a user tries to apply geo distance sorting to a field of the wrong type, they'll get
a 500 error that causes shard failures, because the field data impl gets casted to the
expected type without first checking that the field type is the one expected.
This commit addresses that by returning a 400 error instead.

Closes #129500
elasticsearchmachine pushed a commit that referenced this pull request Jul 11, 2025
…130924) (#131018)

If a user tries to apply geo distance sorting to a field of the wrong type, they'll get
a 500 error that causes shard failures, because the field data impl gets casted to the
expected type without first checking that the field type is the one expected.
This commit addresses that by returning a 400 error instead.

Closes #129500
elasticsearchmachine pushed a commit that referenced this pull request Jul 11, 2025
…130924) (#131020)

If a user tries to apply geo distance sorting to a field of the wrong type, they'll get
a 500 error that causes shard failures, because the field data impl gets casted to the
expected type without first checking that the field type is the one expected.
This commit addresses that by returning a 400 error instead.

Closes #129500
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jul 17, 2025
…lastic#130924)

If a user tries to apply geo distance sorting to a field of the wrong type, they'll get
a 500 error that causes shard failures, because the field data impl gets casted to the
expected type without first checking that the field type is the one expected.
This commit addresses that by returning a 400 error instead.

Closes elastic#129500
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jul 17, 2025
…lastic#130924)

If a user tries to apply geo distance sorting to a field of the wrong type, they'll get
a 500 error that causes shard failures, because the field data impl gets casted to the
expected type without first checking that the field type is the one expected.
This commit addresses that by returning a 400 error instead.

Closes elastic#129500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >bug :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v8.18.5 v8.19.1 v9.0.0 v9.1.0 v9.2.0

Projects

None yet

4 participants