@@ -31,12 +31,24 @@ pub struct ExtractOptions {
3131 pub metadata : Option < HashMap < u64 , MetadataEntry > > ,
3232}
3333
34+ #[ derive( Debug , Clone , Serialize ) ]
35+ #[ serde( rename_all = "snake_case" ) ]
36+ pub struct ExtractIndexProperties {
37+ pub m : u64 ,
38+ pub ef_construction : u64 ,
39+ pub cur_element_count : u64 ,
40+ pub max_elements : u64 ,
41+ pub persisted_version : i32 ,
42+ pub word_size_bytes : u32 ,
43+ }
44+
3445#[ derive( Debug , Clone , Serialize ) ]
3546pub struct ExtractSummary {
3647 pub scanned : u64 ,
3748 pub emitted : u64 ,
3849 pub deleted_skipped : u64 ,
3950 pub dimension : usize ,
51+ pub index_properties : ExtractIndexProperties ,
4052}
4153
4254#[ derive( Debug , Clone ) ]
@@ -131,6 +143,14 @@ where
131143 emitted : 0 ,
132144 deleted_skipped : 0 ,
133145 dimension : header. dimension ( ) ,
146+ index_properties : ExtractIndexProperties {
147+ m : header. m ,
148+ ef_construction : header. ef_construction ,
149+ cur_element_count : header. cur_element_count ,
150+ max_elements : header. max_elements ,
151+ persisted_version : header. persisted_version ,
152+ word_size_bytes : header. word_size . bytes ( ) as u32 ,
153+ } ,
134154 } ;
135155
136156 let delete_marker_offset = header. delete_marker_offset ( ) ;
@@ -506,6 +526,12 @@ mod tests {
506526 assert_eq ! ( summary. emitted, 2 ) ;
507527 assert_eq ! ( summary. deleted_skipped, 1 ) ;
508528 assert_eq ! ( summary. dimension, 3 ) ;
529+ assert_eq ! ( summary. index_properties. m, 4 ) ;
530+ assert_eq ! ( summary. index_properties. ef_construction, 100 ) ;
531+ assert_eq ! ( summary. index_properties. cur_element_count, 3 ) ;
532+ assert_eq ! ( summary. index_properties. max_elements, 3 ) ;
533+ assert_eq ! ( summary. index_properties. persisted_version, 1 ) ;
534+ assert_eq ! ( summary. index_properties. word_size_bytes, 8 ) ;
509535 assert_eq ! ( out. len( ) , 2 ) ;
510536 assert_eq ! ( out[ 0 ] . label, 10 ) ;
511537 assert_eq ! ( out[ 1 ] . label, 30 ) ;
@@ -683,6 +709,18 @@ mod tests {
683709 summary_without_deleted. deleted_skipped,
684710 fixture_records. len( ) as u64 - expected_non_deleted
685711 ) ;
712+ prop_assert_eq!( summary_without_deleted. index_properties. m, 4 ) ;
713+ prop_assert_eq!( summary_without_deleted. index_properties. ef_construction, 100 ) ;
714+ prop_assert_eq!(
715+ summary_without_deleted. index_properties. cur_element_count,
716+ fixture_records. len( ) as u64
717+ ) ;
718+ prop_assert_eq!(
719+ summary_without_deleted. index_properties. max_elements,
720+ capacity as u64
721+ ) ;
722+ prop_assert_eq!( summary_without_deleted. index_properties. persisted_version, 1 ) ;
723+ prop_assert_eq!( summary_without_deleted. index_properties. word_size_bytes, 8 ) ;
686724
687725 for exported in & exported_without_deleted {
688726 let source = & fixture_records[ exported. internal_id as usize ] ;
0 commit comments