Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion protos/index.proto
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,4 @@ message BloomFilterIndexDetails {}

message RTreeIndexDetails {}

message FMIndexIndexDetails {}
message FMIndexDetails {}
9 changes: 2 additions & 7 deletions rust/lance-index/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -87,7 +82,7 @@ impl IndexPluginRegistry {
registry.add_plugin::<pb::BloomFilterIndexDetails, BloomFilterIndexPlugin>();
registry.add_plugin::<pbold::InvertedIndexDetails, InvertedIndexPlugin>();
registry.add_plugin::<pb::JsonIndexDetails, JsonIndexPlugin>();
registry.add_plugin::<pb::FmIndexIndexDetails, FMIndexPlugin>();
registry.add_plugin::<pb::FmIndexDetails, FMIndexPlugin>();
#[cfg(feature = "geo")]
registry.add_plugin::<pb::RTreeIndexDetails, RTreeIndexPlugin>();

Expand Down
8 changes: 3 additions & 5 deletions rust/lance-index/src/scalar/fmindex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ impl ScalarIndex for FMIndexScalarIndex {
) -> Result<CreatedIndex> {
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,
})
Expand Down Expand Up @@ -1708,7 +1708,7 @@ impl ScalarIndexPlugin for FMIndexPlugin {
) -> Result<CreatedIndex> {
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,
})
Expand Down Expand Up @@ -1740,9 +1740,7 @@ impl ScalarIndexPlugin for FMIndexPlugin {
fri: Option<Arc<FragReuseIndex>>,
cache: &LanceCache,
) -> Result<Arc<dyn ScalarIndex>> {
let _ = details
.to_msg::<pb::FmIndexIndexDetails>()
.unwrap_or_default();
let _ = details.to_msg::<pb::FmIndexDetails>().unwrap_or_default();
Ok(FMIndexScalarIndex::load(store, fri, cache).await? as Arc<dyn ScalarIndex>)
}
async fn load_statistics(
Expand Down
4 changes: 2 additions & 2 deletions rust/lance/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(),
Expand Down
Loading