Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

541 B
Raw Blame
import type { Client } from '@opensearch-project/opensearch';

/**
 * Checks if an index exists in OpenSearch.
 * @param opensearchClient An instance of the OpenSearch client.
 * @param indexName The name of the index to check.
 * @returns A Promise that resolves to a boolean indicating whether the index exists.
 */
export async function checkIndexExists(
  opensearchClient: Client,
  indexName: string
): Promise<boolean> {
  const response = await opensearchClient.indices.exists({
    index: indexName,
  });
  return response.body;
}