Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: keywords usage in product_types configuration #372

Merged
merged 3 commits into from Dec 8, 2021

Conversation

sbrunato
Copy link
Collaborator

@sbrunato sbrunato commented Dec 8, 2021

  • new field keywords added in product types configuration file product_types.yml. Field is case insensitive and ignores - or _ characters
  • whoosh product types search index is now rebuilt when product_types.yml MD5 checksum changes instead of eodag version.

This enables the following behavior:

>>> from eodag import EODataAccessGateway
>>> dag = EODataAccessGateway()
>>> dag.guess_product_type(keywords="sentinel* SAFE")
['S1_SAR_GRD', 'S1_SAR_OCN', 'S1_SAR_RAW', 'S1_SAR_SLC', 'S2_MSI_L1C', 'S2_MSI_L2A']
>>> dag.guess_product_type(keywords="landsat* Collection2")
['LANDSAT_C2L1', 'LANDSAT_C2L2ALB_BT', 'LANDSAT_C2L2ALB_SR', 'LANDSAT_C2L2ALB_ST', 'LANDSAT_C2L2ALB_TA', 'LANDSAT_C2L2_SR', 'LANDSAT_C2L2_ST']
>>> dag.guess_product_type(keywords="landsat* Collection2 L1")
['LANDSAT_C2L1']
>>> dag.search(keywords="landsat* Collection2 L1")
# will perform search on LANDSAT_C2L1
>>> dag.guess_product_type(keywords="cog")
['S2_MSI_L2A_COG']
>>> dag.search(keywords="cog")
# will perform search on S2_MSI_L2A_COG

@sbrunato sbrunato merged commit 2841f58 into develop Dec 8, 2021
@sbrunato sbrunato deleted the product_type_keywords branch December 8, 2021 15:07
@sbrunato
Copy link
Collaborator Author

sbrunato commented Jan 4, 2022

fixes #165

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant