Dropping columns from the index

Remove a CQL column from the index.

Remove a CQL column using the ALTER SEARCH INDEX SCHEMA field shortcut. The field is removed based on the name that is defined in the schema.

Procedure

  1. Remove a CQL column from the index:
    • Remove a regular column:
      ALTER SEARCH INDEX SCHEMA ON wiki.solr DROP field intfield;
      ALTER TABLE wiki.solr DROP intfield int;
    • Remove a tuple column from the index:
      When dropping the base field name, drop the TupleField and all the child fields:
      ALTER SEARCH INDEX SCHEMA ON solr.wiki DROP field fieldname;
      To drop individual child fields:
      ALTER SEARCH INDEX SCHEMA ON solr.wiki DROP field "fieldname.field1";
  2. Verify the pending changes:
    DESCRIBE PENDING SEARCH INDEX SCHEMA ON [keyspace_name.]table_name;
  3. Activate the changes:
    RELOAD SEARCH INDEX ON [keyspace_name.]table_name;
    Copies the pending schema over the active schema. New transactions, such as data inserted into the table, are processed using the active schema. The existing data is not effected by a schema change.
  4. Rebuild the index:
    REBUILD SEARCH INDEX ON [keyspace_name.]table_name;
    The REBUILD SEARCH INDEX regenerates the index using existing data. Rebuilding is required when changing the way that data is indexed, such as changing the type of field or if a field is added to the index.