From 85362665c540064f52659b90d263cac6df693cf8 Mon Sep 17 00:00:00 2001 From: Weston Pace Date: Mon, 22 Jun 2026 15:00:32 +0000 Subject: [PATCH 1/3] fix: rename FMIndexIndexDetails to FMIndexDetails and remove special case The proto message was misnamed with a double "Index", causing get_plugin_name_from_details_name to need a special case to map "fmindex" back to "fm". With the corrected name FMIndexDetails, stripping "IndexDetails" yields "fm" directly like all other plugins. Co-Authored-By: Claude Sonnet 4.6 --- protos/index.proto | 2 +- rust/lance-index/src/registry.rs | 9 ++------- rust/lance-index/src/scalar/fmindex.rs | 6 +++--- 3 files changed, 6 insertions(+), 11 deletions(-) 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..f3b4d13f05d 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, }) @@ -1741,7 +1741,7 @@ impl ScalarIndexPlugin for FMIndexPlugin { cache: &LanceCache, ) -> Result> { let _ = details - .to_msg::() + .to_msg::() .unwrap_or_default(); Ok(FMIndexScalarIndex::load(store, fri, cache).await? as Arc) } From 0759e91357969ff43187957b48f768c50f8c3988 Mon Sep 17 00:00:00 2001 From: Weston Pace Date: Mon, 22 Jun 2026 15:13:52 +0000 Subject: [PATCH 2/3] style: fix rustfmt formatting in fmindex.rs Co-Authored-By: Claude Sonnet 4.6 --- rust/lance-index/src/scalar/fmindex.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rust/lance-index/src/scalar/fmindex.rs b/rust/lance-index/src/scalar/fmindex.rs index f3b4d13f05d..0ed144d5275 100644 --- a/rust/lance-index/src/scalar/fmindex.rs +++ b/rust/lance-index/src/scalar/fmindex.rs @@ -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( From e2c964ff427d6d8f96a6790507adcbaa7485754b Mon Sep 17 00:00:00 2001 From: Weston Pace Date: Mon, 22 Jun 2026 15:49:28 +0000 Subject: [PATCH 3/3] fix: update FMIndex type URL checks after FMIndexIndexDetails rename After renaming FMIndexIndexDetails to FMIndexDetails in the proto, segment_has_fmindex_details was still matching the old suffix, causing merge_existing_index_segments to fail. Also add "FM" to the legacy type name mapping since type_name_from_uri now strips IndexDetails from FMIndexDetails to yield "FM" instead of "FMIndex". Co-Authored-By: Claude Sonnet 4.6 --- rust/lance/src/index.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(),