diff --git a/protos/index.proto b/protos/index.proto index b1045f8977c..a72207b59fe 100644 --- a/protos/index.proto +++ b/protos/index.proto @@ -248,4 +248,4 @@ message BloomFilterIndexDetails {} message RTreeIndexDetails {} -message FMIndexIndexDetails {} \ No newline at end of file +message FMIndexDetails {} \ No newline at end of file diff --git a/rust/lance-index/src/registry.rs b/rust/lance-index/src/registry.rs index 1abab781635..bd7448240fe 100644 --- a/rust/lance-index/src/registry.rs +++ b/rust/lance-index/src/registry.rs @@ -44,12 +44,7 @@ impl IndexPluginRegistry { fn get_plugin_name_from_details_name(&self, details_name: &str) -> String { let details_name = Self::normalize_plugin_name(details_name); if details_name.ends_with("indexdetails") { - let plugin_name = details_name.replace("indexdetails", ""); - if plugin_name == "fmindex" { - "fm".to_string() - } else { - plugin_name - } + details_name.replace("indexdetails", "") } else { details_name } @@ -87,7 +82,7 @@ impl IndexPluginRegistry { registry.add_plugin::(); registry.add_plugin::(); registry.add_plugin::(); - registry.add_plugin::(); + registry.add_plugin::(); #[cfg(feature = "geo")] registry.add_plugin::(); diff --git a/rust/lance-index/src/scalar/fmindex.rs b/rust/lance-index/src/scalar/fmindex.rs index cdf19f0304c..0ed144d5275 100644 --- a/rust/lance-index/src/scalar/fmindex.rs +++ b/rust/lance-index/src/scalar/fmindex.rs @@ -1378,7 +1378,7 @@ impl ScalarIndex for FMIndexScalarIndex { ) -> Result { let files = write_partitioned_fmindex_stream(new_data, dest).await?; Ok(CreatedIndex { - index_details: prost_types::Any::from_msg(&pb::FmIndexIndexDetails {}).unwrap(), + index_details: prost_types::Any::from_msg(&pb::FmIndexDetails {}).unwrap(), index_version: FMINDEX_INDEX_VERSION, files, }) @@ -1708,7 +1708,7 @@ impl ScalarIndexPlugin for FMIndexPlugin { ) -> Result { let files = write_partitioned_fmindex_stream(data, store).await?; Ok(CreatedIndex { - index_details: prost_types::Any::from_msg(&pb::FmIndexIndexDetails {}).unwrap(), + index_details: prost_types::Any::from_msg(&pb::FmIndexDetails {}).unwrap(), index_version: FMINDEX_INDEX_VERSION, files, }) @@ -1740,9 +1740,7 @@ impl ScalarIndexPlugin for FMIndexPlugin { fri: Option>, cache: &LanceCache, ) -> Result> { - let _ = details - .to_msg::() - .unwrap_or_default(); + let _ = details.to_msg::().unwrap_or_default(); Ok(FMIndexScalarIndex::load(store, fri, cache).await? as Arc) } async fn load_statistics( diff --git a/rust/lance/src/index.rs b/rust/lance/src/index.rs index 1a3a3aa54ec..d98ab8701c1 100644 --- a/rust/lance/src/index.rs +++ b/rust/lance/src/index.rs @@ -289,7 +289,7 @@ fn segment_has_fmindex_details(segment: &IndexMetadata) -> bool { segment .index_details .as_ref() - .is_some_and(|details| details.type_url.ends_with("FMIndexIndexDetails")) + .is_some_and(|details| details.type_url.ends_with("FMIndexDetails")) } // Cache keys for different index types @@ -458,7 +458,7 @@ fn legacy_type_name(index_uri: &str, index_type_hint: Option<&str>) -> String { "BloomFilter" => IndexType::BloomFilter.to_string(), "RTree" => IndexType::RTree.to_string(), "Inverted" => IndexType::Inverted.to_string(), - "FMIndex" => IndexType::Fm.to_string(), + "FMIndex" | "FM" => IndexType::Fm.to_string(), "Json" => IndexType::Scalar.to_string(), "Flat" | "Vector" => IndexType::Vector.to_string(), other if other.contains("Vector") => IndexType::Vector.to_string(),