Skip to content

Commit 0a7bb16

Browse files
authored
OpenSearch: fix property evaluation (#2189) (#2202)
* OpenSearch: fix property evaluation (#2189) * fix refs
1 parent 5ea1b50 commit 0a7bb16

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

pygeoapi/provider/opensearch_.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ def query(self, offset=0, limit=10, resulttype='results',
231231
}
232232
query['query']['bool']['filter'].append(pf)
233233

234-
if '|' not in prop[1]:
235-
pf['match'][prop_name]['minimum_should_match'] = '100%'
234+
if '|' not in prop[1]:
235+
pf['match'][prop_name]['minimum_should_match'] = '100%'
236236

237237
if sortby:
238238
LOGGER.debug('processing sortby')
@@ -373,7 +373,7 @@ def get(self, identifier, **kwargs):
373373

374374
LOGGER.debug(f'Query: {query}')
375375
try:
376-
result = self.os_search(index=self.index_name, **query)
376+
result = self.os_.search(index=self.index_name, body=query)
377377
if len(result['hits']['hits']) == 0:
378378
LOGGER.error(err)
379379
raise ProviderItemNotFoundError(err)
@@ -425,7 +425,8 @@ def update(self, identifier, item):
425425
identifier, json_data = self._load_and_prepare_item(
426426
item, identifier, raise_if_exists=False)
427427

428-
_ = self.os_index(index=self.index_name, id=identifier, body=json_data)
428+
_ = self.os_.index(index=self.index_name, id=identifier,
429+
body=json_data)
429430

430431
return True
431432

@@ -439,7 +440,7 @@ def delete(self, identifier):
439440
"""
440441

441442
LOGGER.debug(f'Deleting item {identifier}')
442-
_ = self.os_delete(index=self.index_name, id=identifier)
443+
_ = self.os_.delete(index=self.index_name, id=identifier)
443444

444445
return True
445446

0 commit comments

Comments
 (0)