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

MB-58034: Custom Date Time parsers not being applied on query object #1860

Merged
merged 16 commits into from
Sep 7, 2023

Conversation

CascadingRadium
Copy link
Member

@CascadingRadium CascadingRadium commented Jul 31, 2023

Jira

MB-58034

Description

  • Add a new query DateRangeStringQuery, which takes in the start and end bounds as strings and then parses them using either the top level QueryDateTimeParser in the top-level bleve package or the DateTimeParser set in the DateRangeStringQuery struct, if present.
  • ParseQuery, which analyzes a marshalled json to identify the query to run, will now default to DateRangeStringQuery instead, which is better since it already has the dates in string format and unmarshalling to DateRangeQuery will always trigger parsing of the date string with Only QueryDateTimeParser, leaving no room for user config.

search/query/date_range.go Outdated Show resolved Hide resolved
search/query/date_range.go Outdated Show resolved Hide resolved
search/query/date_range.go Outdated Show resolved Hide resolved
search/query/date_range.go Outdated Show resolved Hide resolved
search/query/date_range.go Outdated Show resolved Hide resolved
search/query/date_range.go Outdated Show resolved Hide resolved
Thejas-bhat
Thejas-bhat previously approved these changes Sep 6, 2023
@Thejas-bhat
Copy link
Member

the changes look good to me, however i'd strongly recommend waiting for others' review as well.

Copy link
Member

@abhinavdangeti abhinavdangeti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Couple minor nits, we can merge this after those are addressed.

mapping/index.go Outdated Show resolved Hide resolved
search/query/date_range_string.go Outdated Show resolved Hide resolved
@CascadingRadium CascadingRadium merged commit 7355915 into master Sep 7, 2023
9 checks passed
@CascadingRadium CascadingRadium deleted the MB-58034 branch September 7, 2023 17:03
CascadingRadium added a commit that referenced this pull request Sep 7, 2023
…y object (#1860)

- Add a new query DateRangeStringQuery, which takes in the start and end
bounds as strings and then parses them using the DateTimeParser
set in the DateRangeStringQuery struct, if present and defaults to using the package level
QueryDateTimeParser.
- ParseQuery, which analyzes a marshalled json to identify the query to
run, will now default to DateRangeStringQuery instead, which is preferable because it already has the dates in string format, and unmarshalling to DateRangeQuery will always trigger parsing of the date string with only QueryDateTimeParser, leaving no room for user configuration.
CascadingRadium added a commit that referenced this pull request Sep 13, 2023
…y object (#1860)

- Add a new query DateRangeStringQuery, which takes in the start and end
bounds as strings and then parses them using the DateTimeParser
set in the DateRangeStringQuery struct, if present and defaults to using the package level
QueryDateTimeParser. 
- ParseQuery, which analyzes a marshalled json to identify the query to
run, will now default to DateRangeStringQuery instead, which is preferable because it already has the dates in string format, and unmarshalling to DateRangeQuery will always trigger parsing of the date string with only QueryDateTimeParser, leaving no room for user configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants