Skip to content

V4 how to check existings of a Index #732

@alexander-schranz

Description

@alexander-schranz

On v3 there was:

$searchIndex = $client->initIndex($name);
$searchIndex->exists();

I could not find a existIndex method on v4 client version?

Workaround

try {
    $client->getSettings($indexName);
} catch (NotFoundException) {
    return false;
}

return true;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions