Dropping indexes

Dropping indexes from a graph.

Dropping indexes from a graph is accomplished with schema calls.

Procedure

Drop secondary or materialized index

  • To drop an index from the schema, such as the byMeal index, identify the index by name. Use describe() to examine all indexes for the desired vertex label and find the index name.
    schema.vertexLabel('meal').describe()
  • Using the vertex label and index name, remove the index. Run describe() again to verify that the index is removed.
    schema.vertexLabel('meal').index('byMeal').remove()
    schema.vertexLabel('meal').describe()

Drop single property in search index

  • To drop a property from a search index in the schema, such as the nick_name property, identify the property name. Use describe() to examine the search index for the desired vertex label and find the property name.
    schema.vertexLabel('author').describe()
  • Using the vertex label, property name, and index name, remove the index. Run describe() again to verify that the index is removed.
    schema.vertexLabel('author').index('search').search().properties('nick_name').remove()
    schema.vertexLabel('author').describe()