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

Fix issue in parsing datetime field #2030

Merged
merged 1 commit into from
May 3, 2024
Merged

Fix issue in parsing datetime field #2030

merged 1 commit into from
May 3, 2024

Conversation

CascadingRadium
Copy link
Member

@CascadingRadium CascadingRadium commented May 3, 2024

Addresses #2027

In bleve v2.3.10, a bug fix 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.

@CascadingRadium CascadingRadium changed the title fix bug https://github.com/blevesearch/bleve/issues/2027 fix bug May 3, 2024
@abhinavdangeti abhinavdangeti changed the title fix bug Fix issue in parsing datetime field May 3, 2024
@abhinavdangeti abhinavdangeti added this to the v2.4.1 milestone May 3, 2024
@CascadingRadium CascadingRadium merged commit 490c4b9 into master May 3, 2024
9 checks passed
@CascadingRadium CascadingRadium deleted the tme branch May 3, 2024 20:11
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.

2 participants