@Override
  public void removeIndex(String columnName, IndexType<?, ?, ?> indexType) {
    // Text index is kept in its own files, thus can be removed directly.
    if (indexType == StandardIndexes.text()) {
      TextIndexUtils.cleanupTextIndex(_segmentDirectory, columnName);
      return;
    }
    if (indexType == StandardIndexes.vector()) {
      VectorIndexUtils.cleanupVectorIndex(_segmentDirectory, columnName);
      return;
    }
    // Only remember to cleanup indices upon close(), if any existing
    // index gets marked for removal.
    if (_columnEntries.remove(new IndexKey(columnName, indexType)) != null) {
      _shouldCleanupRemovedIndices = true;
    }
  }
@Test
  public void testRemoveIndex()
      throws IOException, ConfigurationException {
    try (SingleFileIndexDirectory sfd = new SingleFileIndexDirectory(TEMP_DIR, _segmentMetadata, ReadMode.mmap)) {
      sfd.newBuffer("col1", StandardIndexes.dictionary(), 1024);
      sfd.removeIndex("col1", StandardIndexes.dictionary());
      assertFalse(sfd.hasIndexFor("col1", StandardIndexes.dictionary()));
    }
  }