safeguard missing properties during .../items queries using properties= (#1356)

This commit is contained in:
Tom Kralidis
2023-09-29 16:38:02 -04:00
committed by GitHub
parent e1ee5fcbc3
commit 6eb272074b
+3 -2
View File
@@ -463,9 +463,10 @@ class ElasticsearchProvider(BaseProvider):
LOGGER.debug('Fetching id and geometry from GeoJSON document')
feature_ = doc['_source']
if self.id_field in doc['_source']['properties']:
try:
id_ = doc['_source']['properties'][self.id_field]
else:
except KeyError as err:
LOGGER.debug(f'Missing field: {err}')
id_ = doc['_source'].get('id', doc['_id'])
feature_['id'] = id_