@@ -565,7 +565,7 @@ impl SerializedSearchIndex {
565565 Some ( self_generic_inverted_index) => self_generic_inverted_index,
566566 None => self . generic_inverted_index . push_mut ( Vec :: new ( ) ) ,
567567 } ;
568- self_generic_inverted_index. resize ( size, Vec :: new ( ) ) ;
568+ self_generic_inverted_index. resize ( size + 1 , Vec :: new ( ) ) ;
569569 self_generic_inverted_index[ size] . extend (
570570 other_list
571571 . iter ( )
@@ -1875,11 +1875,11 @@ pub(crate) fn build_index(
18751875 . inverted_function_inputs_index
18761876 } else {
18771877 let generic_id = usize:: try_from ( -index) . unwrap ( ) - 1 ;
1878- serialized_index. generic_inverted_index . resize ( generic_id, Vec :: new ( ) ) ;
1878+ serialized_index. generic_inverted_index . resize ( generic_id + 1 , Vec :: new ( ) ) ;
18791879 & mut serialized_index. generic_inverted_index [ generic_id]
18801880 } ;
18811881 // FIXME(yotamofek): last item should have capacity of 1
1882- postings. resize ( search_type_size, Vec :: new ( ) ) ;
1882+ postings. resize ( search_type_size + 1 , Vec :: new ( ) ) ;
18831883 let posting = & mut postings[ search_type_size] ;
18841884 if posting. last ( ) != Some ( & ( new_entry_id as u32 ) ) {
18851885 posting. push ( new_entry_id as u32 ) ;
@@ -1900,7 +1900,7 @@ pub(crate) fn build_index(
19001900 & mut serialized_index. generic_inverted_index [ generic_id]
19011901 } ;
19021902 // FIXME(yotamofek): last item should have capacity of 1
1903- postings. resize ( search_type_size, Vec :: new ( ) ) ;
1903+ postings. resize ( search_type_size + 1 , Vec :: new ( ) ) ;
19041904 let posting = & mut postings[ search_type_size] ;
19051905 if posting. last ( ) != Some ( & ( new_entry_id as u32 ) ) {
19061906 posting. push ( new_entry_id as u32 ) ;
0 commit comments