diff --git a/cozo-core/src/runtime/relation.rs b/cozo-core/src/runtime/relation.rs index fd0391fc..932c7aeb 100644 --- a/cozo-core/src/runtime/relation.rs +++ b/cozo-core/src/runtime/relation.rs @@ -1382,6 +1382,7 @@ impl<'a> SessionTx<'a> { if rel.indices.remove(&idx_name.name).is_none() && rel.hnsw_indices.remove(&idx_name.name).is_none() && rel.lsh_indices.remove(&idx_name.name).is_none() + && rel.fts_indices.remove(&idx_name.name).is_none() { #[derive(Debug, Error, Diagnostic)] #[error("index {0} for relation {1} not found")] diff --git a/cozo-core/src/runtime/tests.rs b/cozo-core/src/runtime/tests.rs index 61744122..39e97d84 100644 --- a/cozo-core/src/runtime/tests.rs +++ b/cozo-core/src/runtime/tests.rs @@ -1532,3 +1532,25 @@ fn hnsw_index() { "#).unwrap(); println!("{}", res.into_json()["rows"][0][4]); } + +#[test] +fn fts_drop() { + let db = DbInstance::default(); + db.run_default( + r#" + :create entity {name} + "#, + ) + .unwrap(); + db.run_default( + r#" + ::fts create entity:fts_index { extractor: name, + tokenizer: Simple, filters: [Lowercase] + } + "#, + ) + .unwrap(); + db.run_default(r#" + ::fts drop entity:fts_index + "#).unwrap(); +} \ No newline at end of file