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

Support relative date ranges in search #3545

Closed
3 tasks
chouinar opened this issue Jan 16, 2025 · 0 comments · Fixed by #3640
Closed
3 tasks

Support relative date ranges in search #3545

chouinar opened this issue Jan 16, 2025 · 0 comments · Fixed by #3640
Assignees

Comments

@chouinar
Copy link
Collaborator

chouinar commented Jan 16, 2025

Summary

This requires two sets of changes:

  • Our API schema needs to allow relative date ranges (negative/positive integers representing days)
  • We need to be able to pass in relative date ranges to the search index

I'd recommend first reading the docs on date ranges: https://opensearch.org/docs/latest/query-dsl/term/range/ and manually determining what the query needs to be to do this.

For the API schema, we currently support:

    "post_date": {
      "end_date": "2024-02-01",
      "start_date": "2024-01-01"
    }

We should allow:

    "post_date": {
      "end_date_relative": -15,
      "start_date_relative": 15
    }

These should be mutually exclusive, which may require some more complex rules on the schema than what we previously have done.

Acceptance criteria

  • API supports relative date range (specific range still allowed/supported)
  • Search client updated to support relative date range
  • Tests added to validate this behavior
@chouinar chouinar moved this from Icebox to Todo in Simpler.Grants.gov Product Backlog Jan 16, 2025
@babebe babebe self-assigned this Jan 16, 2025
@babebe babebe moved this from Todo to In Progress in Simpler.Grants.gov Product Backlog Jan 22, 2025
@babebe babebe moved this from In Progress to In Review in Simpler.Grants.gov Product Backlog Jan 24, 2025
@babebe babebe linked a pull request Jan 24, 2025 that will close this issue
babebe added a commit that referenced this issue Jan 28, 2025
## Summary
Fixes #{[3545](#3545)}

### Time to review: __10 mins__

## Changes proposed
API supports relative date range (specific range still
allowed/supported)
Search client updated to support relative date range
Tests

---------

Co-authored-by: nava-platform-bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants