Skip to content

Python - Is Index Exists #30

Closed
Closed

Description

@aviperetz34

when upgrading from 0.4 to 0.9, creating an existing index raised a ResponseError.
is there a way to check if index exist without an exception?

Activity

  1. dvirsky commented on Mar 6, 2017

    @dvirsky
    Contributor

    First of all, if you are upgrading between 0.4 and 0.9 you need to delete the data and start fresh.

    Second, the way to check the existence of an index is to call FT.INFO on it, and if the index does not exist you receive an error.

    So basically:

    try:
      client.info()
    except ResponseError:
      client.create_index(...)
  2. dvirsky commented on Mar 8, 2017

    @dvirsky
    Contributor

    I'm closing the issue as this doesn't seem to be a bug.

    I might change the key naming in a future version in a way that the usual redis EXISTS and TYPE commands will apply to inverted indexes.

  3. added a commit that references this issue on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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