opensearch-project / OpenSearch-Dashboards

📊 Open source visualization dashboards for OpenSearch.
https://opensearch.org/docs/latest/dashboards/index/
Apache License 2.0
1.7k stars 898 forks source link

Migrate from legacy client to opensearch client #2220

Open zhongnansu opened 2 years ago

zhongnansu commented 2 years ago

Legacy ES client is still used in many places in OSD. E.g. https://github.com/opensearch-project/OpenSearch-Dashboards/blob/730a75a3b0515d2e827576a33323436f051bd3e0/src/plugins/index_pattern_management/server/routes/resolve_index.ts#L59-L64

Since opensearch js client is available, do we have a plan for OSD core to migrate to use new client, and remove legacy client? For example the above code in index_pattern_management can be migrated to something like below, that uses new client.

  const { body } = await context.core.elasticsearch.client.asCurrentUser.indices.resolveIndex({
        name: req.params.query,
        expand_wildcards: req.query.expand_wildcards || 'open',
      });
      return res.ok({ body });
kristenTian commented 2 years ago

[Triage]: No plan yet but we need one for migrating off the legacy one.
This will be with a scope of a project but not a quick task.

@seanneumann @ahopp

zhongnansu commented 1 year ago

add @dagneyb