Skip to content

Commit

Permalink
fix STAC search collections handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis authored and kalxas committed Oct 17, 2023
1 parent 7fd98f3 commit b4110a3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pycsw/ogc/api/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,9 @@ def items(self, headers_, json_post_data, args, collection='metadata:main'):
if k == 'ids':
ids = ','.join(f'"{x}"' for x in v.split(','))
query_args.append(f"identifier IN ({ids})")
elif k == 'collections':
collections = ','.join(f'"{x}"' for x in v.split(','))
query_args.append(f"parentidentifier IN ({collections})")
elif k == 'anytext':
query_args.append(build_anytext(k, v))
elif k == 'bbox':
Expand All @@ -603,11 +606,6 @@ def items(self, headers_, json_post_data, args, collection='metadata:main'):
LOGGER.debug('Adding virtual collection filter')
query_args.append(f'parentidentifier = "{collection}"')

if 'collections' in args:
LOGGER.debug('Adding collections filter')
for collection in args['collections'].split(','):
query_args.append(f'parentidentifier = "{collection}"')

LOGGER.debug('Evaluating CQL and other specified filtering parameters')
if cql_query is not None and query_args:
LOGGER.debug('Combining CQL and other specified filtering parameters')
Expand Down

0 comments on commit b4110a3

Please sign in to comment.