Skip to content

Automatic and configurable keyword-index sorting - #854

Open
msordi wants to merge 2 commits into
stac-utils:mainfrom
msordi:feature/issue-818
Open

Automatic and configurable keyword-index sorting#854
msordi wants to merge 2 commits into
stac-utils:mainfrom
msordi:feature/issue-818

Conversation

@msordi

@msordi msordi commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Related Issue(s):

Description:

Adds configurable sort-field remapping and defaults collection title to text + title.keyword so collection titles are sortable without custom mapping, while preserving explicit override support and auto-detection for mapped keyword subfields.

PR Checklist:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable
  • Changes are added to the changelog

@jonhealy1

jonhealy1 commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Hi @msordi. This pr is looking really good. Thanks for working on this.

What are your thoughts on using an item-specific env var (STAC_FASTAPI_ITEMS_SORT_FIELD_REMAPS) alongside the collections-specific one and dropping the global remap variable altogether?

Because STAC Items nest fields under properties. (e.g., properties.title) while Collections store them at the root (title), a global variable can leak Item-specific paths into Collection queries if an operator sets a remap for an overlapping field name. Isolating them into ITEMS and COLLECTIONS keeps both route domains clean.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants