Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update search limit to maximum to encompass <12k results without exce… #46

Merged
merged 1 commit into from
Nov 22, 2024
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
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
Loading