Skip to content

Question: How to check if an index is already exisiting? #61

Open
@inpresif

Description

@inpresif

Right now, if you click refresh page you will get an error the index exists:

Fatal error: Uncaught Predis\Response\ServerException: Index already exists in /var/www/html/vendor/predis/predis/src/Client.php

Any way to verify if it already exists and if so, move on to setting the index without creating it First? Try/Catch didn't work.

EDIT:

Adding a question since it's not documented :-). It this the correct way to add arguments?

$builder->setIndex($index_name)
  ->addTextField('uuid')
  ->addTextField('title')
  ->addTextField('content')
  ->addVectorField('title_vector', 'FLAT', 'float', $title_vector_dim, $distance_metric)
  ->addVectorField('content_vector', 'FLAT', 'float', $content_vector_dim, $distance_metric)
  ->addNumericField('tokens')
  ->setTemporary(3600)   <------ ADDING ARGS LIKE THIS
  ->create($client);

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions