Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Changed

- updated `numReturned` & `numMatched` fields in itemCollection return to `numberReturned` & `numberMatched`. [#446](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/446)

## [v6.3.0] - 2025-09-16

### Added
Expand Down
4 changes: 2 additions & 2 deletions stac_fastapi/core/stac_fastapi/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,8 @@ async def post_search(
type="FeatureCollection",
features=items,
links=links,
numReturned=len(items),
numMatched=maybe_count,
numberReturned=len(items),
numberMatched=maybe_count,
)


Expand Down
4 changes: 2 additions & 2 deletions stac_fastapi/tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ async def test_app_context_results(app_client, txn_client, ctx, load_test_data):

resp_json = resp.json()
assert len(resp_json["features"]) == 1
assert resp_json["numReturned"] == 1
if matched := resp_json.get("numMatched"):
assert resp_json["numberReturned"] == 1
if matched := resp_json.get("numberMatched"):
assert matched == 1


Expand Down
10 changes: 5 additions & 5 deletions stac_fastapi/tests/resources/test_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ async def test_get_item_collection(app_client, ctx, txn_client):
assert resp.status_code == 200

item_collection = resp.json()
if matched := item_collection.get("numMatched"):
if matched := item_collection.get("numberMatched"):
assert matched == item_count + 1


Expand Down Expand Up @@ -294,13 +294,13 @@ async def test_pagination(app_client, load_test_data):
)
assert resp.status_code == 200
first_page = resp.json()
assert first_page["numReturned"] == 3
assert first_page["numberReturned"] == 3

url_components = urlsplit(first_page["links"][0]["href"])
resp = await app_client.get(f"{url_components.path}?{url_components.query}")
assert resp.status_code == 200
second_page = resp.json()
assert second_page["numReturned"] == 3
assert second_page["numberReturned"] == 3


@pytest.mark.skip(reason="created and updated fields not be added with stac fastapi 3?")
Expand Down Expand Up @@ -615,14 +615,14 @@ async def test_item_search_get_query_extension(app_client, ctx):
),
}
resp = await app_client.get("/search", params=params)
assert resp.json()["numReturned"] == 0
assert resp.json()["numberReturned"] == 0

params["query"] = json.dumps(
{"proj:epsg": {"eq": test_item["properties"]["proj:epsg"]}}
)
resp = await app_client.get("/search", params=params)
resp_json = resp.json()
assert resp_json["numReturned"] == 1
assert resp_json["numberReturned"] == 1
assert (
resp_json["features"][0]["properties"]["proj:epsg"]
== test_item["properties"]["proj:epsg"]
Expand Down