Skip to content

Set IndicesOptions ignoreUnavailable to be true to skip the non-exist indices in the SearchRequest

Zhibin Mai requested to merge indices_ignoreUnavailable into master

Type of change

  • Bug Fix
  • Feature

Please provide link to gitlab issue or ADR(Architecture Decision Record)

Does this introduce a change in the core logic?

  • [YES/NO] YES

Does this introduce a change in the cloud provider implementation, if so which cloud?

  • AWS
  • Azure
  • Google Cloud
  • IBM

Does this introduce a breaking change?

  • [YES/NO] NO

What is the current behavior?

In multi-kinds search, if the index of any kind does not exist, ElasticSearch will throw NOT_FOUND exception and OSDU search service catches the ElasticSearch exception and returns 0 result with code 200.

What is the new/expected behavior?

In multi-kinds search, if the index of any kind does not exist, ElasticSearch will skip the non-existing indices and return search results for the remaining valid indices. No exception will be thrown by ElasticSearch in this case. No special handle for ElasticSearch NOT_FOUND exception is required.

Have you added/updated Unit Tests and Integration Tests?

Yes

Any other useful information

ElasticSearch Exists API

Edited by Zhibin Mai

Merge request reports

Loading