You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
field :updated_at should store date with microseconds, e.g. 2022-07-20T02:00:08.123456Z
Actual behavior
field :updated_at stores date with milliseconds, e.g. 2022-07-20T02:00:08.123Z field :updated_at, type: "date" correctly stores date with microseconds
This causes chewy:sync to always show all documents as outdated (the match fails on the microsecond to millisecond comparison, unless the microseconds actually happens to be 000).
Steps to reproduce the problem
To view bug:
Specify index with field :updated_at.
rake chewy:reset
View a document and see it only has millisecond precision
rake chewy:sync (updates all documents)
rake chewy:sync (updates all documents again)
To view workaround:
Specify index with field :updated_at, type: "date".
rake chewy:reset
View a document and see it correctly has microsecond precision
rake chewy:sync (no updates)
rake chewy:sync (no updates)
Version Information
Share here essential version information such as:
Chewy version: 7.2.6
Elasticsearch version: 8.3.3
Ruby version: 3.1.2p20
Rails version: 7.0.3.1
The text was updated successfully, but these errors were encountered:
gabriel
changed the title
Index field looses date precision if type not explicitly set to date
Index field looses date precision if type not explicitly set to date (and causes sync to always update all documents)
Aug 4, 2022
Expected behavior
field :updated_at
should store date with microseconds, e.g.2022-07-20T02:00:08.123456Z
Actual behavior
field :updated_at
stores date with milliseconds, e.g.2022-07-20T02:00:08.123Z
field :updated_at, type: "date"
correctly stores date with microsecondsThis causes chewy:sync to always show all documents as outdated (the match fails on the microsecond to millisecond comparison, unless the microseconds actually happens to be 000).
Steps to reproduce the problem
To view bug:
field :updated_at
.rake chewy:reset
rake chewy:sync
(updates all documents)rake chewy:sync
(updates all documents again)To view workaround:
field :updated_at, type: "date"
.rake chewy:reset
rake chewy:sync
(no updates)rake chewy:sync
(no updates)Version Information
Share here essential version information such as:
The text was updated successfully, but these errors were encountered: