From 3016cb73c673de579963de3ea8f2c2a205b13faf Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Fri, 14 Oct 2022 12:54:25 -0400 Subject: [PATCH] do not set ES dates as raw (#1015) * do not set ES dates as raw * safeguard --- pygeoapi/provider/elasticsearch_.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pygeoapi/provider/elasticsearch_.py b/pygeoapi/provider/elasticsearch_.py index 9072189..47e2b69 100644 --- a/pygeoapi/provider/elasticsearch_.py +++ b/pygeoapi/provider/elasticsearch_.py @@ -266,7 +266,8 @@ class ElasticsearchProvider(BaseProvider): sp = sort['property'] - if self.fields[sp]['type'] == 'string': + if (self.fields[sp]['type'] == 'string' + and self.fields[sp].get('format') != 'date'): LOGGER.debug('setting ES .raw on property') sort_property = '{}.raw'.format(self.mask_prop(sp)) else: