Closed acouch closed 1 month ago
Migrated from https://github.com/navapbc/simpler-grants-gov/issues/164 Originally created by @chouinar on Mon, 22 Jul 2024 17:15:42 GMT
Update https://github.com/navapbc/simpler-grants-gov/blob/main/api/src/adapters/search/opensearch_query_builder.py to allow for us to pass in date fields with start/end values and handle converting to the proper opensearch request. A null start or end date should be considered valid (and treated as open-ended). We should treat dates as inclusive (so gte instead of gt).
gte
gt
See: https://opensearch.org/docs/latest/query-dsl/term/range/#date-fields for details on how to construct these queries.
I suggest you add dates to the test data in https://github.com/navapbc/simpler-grants-gov/blob/main/api/tests/src/adapters/search/test_opensearch_query_builder.py in order to test this easily.
Migrated from https://github.com/navapbc/simpler-grants-gov/issues/164#issuecomment-2356635240 Originally created by @acouch on Tue, 17 Sep 2024 18:36:31 GMT
Issue migrated to hhs/simpler-grants-gov#2043
Migrated from https://github.com/navapbc/simpler-grants-gov/issues/164 Originally created by @chouinar on Mon, 22 Jul 2024 17:15:42 GMT
Summary
Update https://github.com/navapbc/simpler-grants-gov/blob/main/api/src/adapters/search/opensearch_query_builder.py to allow for us to pass in date fields with start/end values and handle converting to the proper opensearch request. A null start or end date should be considered valid (and treated as open-ended). We should treat dates as inclusive (so
gte
instead ofgt
).See: https://opensearch.org/docs/latest/query-dsl/term/range/#date-fields for details on how to construct these queries.
I suggest you add dates to the test data in https://github.com/navapbc/simpler-grants-gov/blob/main/api/tests/src/adapters/search/test_opensearch_query_builder.py in order to test this easily.
Acceptance criteria