OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

Unable to filter entities by glossary-term in search-query

Open darth-coder00 opened this issue 4 years ago • 1 comments

Affected module Does it impact the UI, backend or Ingestion Framework? Backend - Elasticsearch

Describe the bug After adding glossary-term as tag to any entity, unable to filter entities by that glossary-term from search-query

To Reproduce

  1. Add a glossary-term as tag to any entity, for instance: a table
  2. Hit search API with tags filter where tags=. For eg., http://localhost:8585/api/v1/search/query?q=*%20AND%20(tags:Business%20Glossary.Clothing.Topwear)&from=0&size=10&index=dashboard_search_index,topic_search_index,table_search_index,pipeline_search_index
  3. It gives 0 results

Expected behavior Searching by added glossary-term as tags filter should give appropriate results

Version:

  • OS: [e.g. iOS]
  • Python version:
  • OpenMetadata version: [e.g. 0.8]
  • OpenMetadata Ingestion package version: [e.g. openmetadata-ingestion[docker]==XYZ]

Additional context None

darth-coder00 avatar Mar 08 '22 18:03 darth-coder00

@darth-coder00 so whenever any tag or for that matter any aggregation has a space in between it will fail the way we are querying fails. So the terms needs to be double quoted like below http://localhost:8585/api/v1/search/query?q=*%20AND%20(tags:%22Business%20Glossary.Products.Clothing.Pants%22)&from=0&size=10&sort_field=last_updated_timestamp&sort_order=desc&index=table_search_index

it will work for non space terms as well http://localhost:8585/api/v1/search/query?q=*%20AND%20(tags:%22PersonalData.Personal%22)&from=0&size=10&sort_field=last_updated_timestamp&sort_order=desc&index=table_search_index

@darth-coder00 assigning it back to you add this to UI. You can add this to all the terms.

harshach avatar Mar 08 '22 21:03 harshach