-
Notifications
You must be signed in to change notification settings - Fork 689
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-58110: Format dates in search result correctly #1868
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thejas-bhat
reviewed
Aug 22, 2023
abhinavdangeti
approved these changes
Aug 25, 2023
abhinavdangeti
added a commit
that referenced
this pull request
Aug 25, 2023
* Save the layout in a custom date time parser, that successfully parses a date time string, as part of a stored field and then use the same layout to format the time object back to its original format upon calling the DateTime() function. * Address code review comments --------- Co-authored-by: Abhinav Dangeti <[email protected]>
CascadingRadium
added a commit
that referenced
this pull request
Aug 31, 2023
* Save the layout in a custom date time parser, that successfully parses a date time string, as part of a stored field and then use the same layout to format the time object back to its original format upon calling the DateTime() function. * Address code review comments --------- Co-authored-by: Abhinav Dangeti <[email protected]>
CascadingRadium
added a commit
that referenced
this pull request
May 3, 2024
Addresses #2027 In bleve v2.3.10, [a bug fix](#1868) was introduced where the value of a datetime field in the Fields part of a search hit was made to match the value actually present in the document. - For example if a document A was indexed and had value of a datetime field X to be "2001/08/20 03:00:10", and ifA was returned as part of the search result, A's Fields will have a map which would look like - Before Fix - "X" : "2001-08-20T03:00:10Z" - After fix - "X" : "2001/08/20 03:00:10" This would come to play in case of custom user defined date time parser, and we did this by storing the layout with which the time string was parsed with during indexing. With timestamp support being added at the same time, they did not really have a valid layout to store and hence stored nil. During queries, the layout extracted, if null, was always assumed to be for the timestamp case _but_ the case where an existing index from pre v2.3.10 (which would also return null layout) was not handled and it became a catchall case leading to the datetime string being always returned in a timestamp rather than the expected default RFC3339.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira
MB-58110
Description
Currently, the datetime fields stored in the Hits.Fields section of the search result object is always formatted to RFC3339. Therefore, when the user applies a
Must merge blevesearch/bleve_index_api#37 first