Skip to content

Commit

Permalink
fix: Update search limit to maximum to encompass <12k results without…
Browse files Browse the repository at this point in the history
… exceeding max offset of 10,000 (#46)
  • Loading branch information
ceholden authored Nov 22, 2024
1 parent e202d60 commit 5d81de9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lambdas/link_fetcher/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def get_query_parameters(start: int, day: date) -> Mapping[str, Any]:
"startDate": f"{oldest_acquisition_date.strftime('%Y-%m-%d')}T00:00:00Z",
"sortParam": "published",
"sortOrder": "desc",
"maxRecords": 100,
"maxRecords": 2000,
# `start` is 0-based, but `index` is 1-based, so we must add 1
"index": start + 1,
# Fix for issue #28, due to breaking change in the OpenSearch API
Expand Down
2 changes: 1 addition & 1 deletion lambdas/link_fetcher/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def generate_mock_responses_for_one_day(mock_search_response):
"&startDate=2019-12-02T00:00:00Z"
"&sortParam=published"
"&sortOrder=desc"
"&maxRecords=100"
"&maxRecords=2000"
"&index={1}"
"&exactCount=1"
)
Expand Down
10 changes: 5 additions & 5 deletions lambdas/link_fetcher/tests/test_link_fetcher_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_that_link_fetcher_handler_generates_correct_query_parameters():
"startDate": "2019-12-02T00:00:00Z",
"sortParam": "published",
"sortOrder": "desc",
"maxRecords": 100,
"maxRecords": 2000,
# `start` is 0-based, but `index` is 1-based, so we must add 1 when
# computing the page number from the `start` index.
"index": 1,
Expand Down Expand Up @@ -92,7 +92,7 @@ def test_that_link_fetcher_handler_gets_correct_query_results(mock_search_respon
"&startDate=2019-12-02T00:00:00Z"
"&sortParam=published"
"&sortOrder=desc"
"&maxRecords=100"
"&maxRecords=2000"
"&index=1"
"&exactCount=1"
),
Expand Down Expand Up @@ -124,7 +124,7 @@ def test_that_link_fetcher_handler_defaults_total_results_to_neg1_when_missing(
"&startDate=2019-12-02T00:00:00Z"
"&sortParam=published"
"&sortOrder=desc"
"&maxRecords=100"
"&maxRecords=2000"
"&index=1"
"&exactCount=1"
),
Expand Down Expand Up @@ -155,7 +155,7 @@ def test_that_link_fetcher_handler_defaults_total_results_to_neg1_when_null(
"&startDate=2019-12-02T00:00:00Z"
"&sortParam=published"
"&sortOrder=desc"
"&maxRecords=100"
"&maxRecords=2000"
"&index=1"
"&exactCount=1"
),
Expand Down Expand Up @@ -186,7 +186,7 @@ def test_that_link_fetcher_handler_gets_correct_query_results_when_no_imagery_le
"&startDate=2019-12-02T00:00:00Z"
"&sortParam=published"
"&sortOrder=desc"
"&maxRecords=100"
"&maxRecords=2000"
"&index=1"
"&exactCount=1"
),
Expand Down

0 comments on commit 5d81de9

Please sign in to comment.