Dropping indexes
Dropping indexes from a graph is accomplished with schema
calls.
-
Drop secondary or materialized index
-
To drop an index from the schema, such as the
byMeal
index, identify the index by name. Usedescribe()
to examine all indexes for the desired vertex label and find the index name.schema.vertexLabel('meal').describe()
Drop index part one -
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 index part two -
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. Usedescribe()
to examine the search index for the desired vertex label and find the property name.schema.vertexLabel('author').describe()
Drop index part three -
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()
Drop index part four