Parse data facets from epoch milliseconds format to seconds

Created on 26 November 2019, about 5 years ago
Updated 8 April 2024, 8 months ago

Elasticsearch connector for Drupal 8 doesn't support facet date.
Fields date are stored in Elasticsearch service in 'strict_date_optional_time||epoch_second' format.
Dates are stored in milliseconds (example 1409231700000).
The facets module require date in timestamp seconds format (1409231700). The facets from elasticsearch values are broken.

Elasticsearch connector to Drupal 8 have a parseSearchFacets function in SearchApiElasticsearchBackend.php file but is never called. parseSearchFacets function contains the conversion from epoch milliseconds to seconds.

I created a patch to convert the date from epoch milliseconds format to seconds. The patch add parseDateFacets function.
The patch have the same behavior of Elasticsearch connector for Drupal 7. The date is divided by 1000.

🐛 Bug report
Status

Fixed

Version

7.0

Component

Elasticsearch Connector

Created by

🇮🇹Italy marco.aresu Cagliari

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024