GSA / GSA/data.gov

Catalog-API: distance sort silently falls back to relevance with no warning

Open
#5,898 0 comments 0 reactions 0 assignees View on GitHub
API bug Catalog
Dominant language
Python
Stars
1.1k
Forks
200
Avg merge
4h 56m
Merged PRs (30d)
5

Description

## Description
Requesting `sort=distance` on `/search` returns results sorted by `relevance` with no indication the requested sort was ignored.

## Steps to Reproduce
GET https://catalog.data.gov/search?sort=distance

## Expected Behavior
Either return distance-sorted results (with a defined spatial reference point) or return a clear error explaining that a location context is required.

## Actual Behavior
HTTP 200 with results sorted by relevance. The response `sort` field says `relevance` -- no indication the requested sort was ignored or unsupported.

## Notes
Confirmed April 27, 2026. Need to clarify whether `distance` sort requires `spatial_geometry` to work, and if so document the requirement. If not, this may be a broken feature.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.