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. Use describe() to examine all indexes for the desired vertex label and find the index name.

    schema.vertexLabel('meal').describe()
    dropIndex1
    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()
    dropIndex2
    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. Use describe() to examine the search index for the desired vertex label and find the property name.

    schema.vertexLabel('author').describe()
    dropIndex3
    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()
    dropIndex4
    Drop index part four

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com