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

feat: datetimes and ranges #1122

Merged
merged 29 commits into from
May 21, 2024
Merged

feat: datetimes and ranges #1122

merged 29 commits into from
May 21, 2024

Conversation

sardination
Copy link
Contributor

@sardination sardination commented May 10, 2024

Ticket(s) Closed

What

Adds support for dates, timestamps, and time.
Adds support for range queries.
Fixed existing term bugs and added tests.

Why

Indexing and searching on time and date!
Searching for fields by range.

How

Add support via tantivy and time conversions.
Add support via tantivy range translation.

Tests

Added search and indexing tests for date, time, timestamps, and timezones (for time and timestamp).
Added range tests.

@neilyio
Copy link
Contributor

neilyio commented May 10, 2024

Fantastic. This is an awesome feature. I'm not sure which of the advanced query builder functions is most appropriate to use with dates/times... but could you:

  • find that out
  • add a test for it
  • add it to the docs

Users are relying more and more on the advanced query interface, so I want to make sure that dates are working correctly there.

@neilyio
Copy link
Contributor

neilyio commented May 10, 2024

Do you plan to also support TIMESTAMPZ?

@sardination
Copy link
Contributor Author

Do you plan to also support TIMESTAMPZ?

Ooh yes, thanks for catching!

@neilyio
Copy link
Contributor

neilyio commented May 11, 2024

It looks like you use and_utc and to_utc to convert the timezone to UTC as Tantivy expects it during insert/query. That sounds correct. Does anything need to be done with the retrieved value in a query to ensure correct timezone?

@sardination sardination changed the title feat: pg_search support for timestamp and date [wip] feat: pg_search support for timestamp and date May 13, 2024
@philippemnoel philippemnoel marked this pull request as draft May 16, 2024 17:51
@sardination sardination changed the title [wip] feat: pg_search support for timestamp and date feat: pg_search support for timestamp and date May 17, 2024
@sardination sardination marked this pull request as ready for review May 17, 2024 20:23
@philippemnoel philippemnoel marked this pull request as draft May 18, 2024 02:44
@sardination sardination changed the title feat: pg_search support for timestamp and date feat: datetimes and ranges May 21, 2024
@sardination sardination marked this pull request as ready for review May 21, 2024 19:34
@sardination sardination merged commit 4442b6c into dev May 21, 2024
18 checks passed
@sardination sardination deleted the feat/search-date branch May 21, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for indexing DateTime types
3 participants