lb-rs: fix duplicate search results#4062
Conversation
I do want to be able to search via ID |
| let deleted_ids = replacement_index.compute_deleted(¤t_index); | ||
| *lb.search.metadata_index.write().await = replacement_index; | ||
| lb.update_tantivy(vec![], deleted_ids).await; | ||
| lb.update_tantivy(deleted_ids, vec![]).await; |
There was a problem hiding this comment.
this is a crazy mistake for me to have made, nice catch
I would remove, but I would not mind if you do not remove, could go either way. |
Parth
left a comment
There was a problem hiding this comment.
nice, #4062 (comment) is the only thing I care about
Agreed not totally needed - leaning towards leaving it since I would assume |
Using |
|
The old code has this: for id in delete {
let term = Term::from_field_text(id_str, &id.to_string());
index_writer.delete_term(term);
}so does this not delete the whole entry? It just clears out that field? I think having both |
It doesn't delete anything since id_str is tokenized and it fails to find it |
|
I see, unfortunate API design, sounds good best of luck |
Did a few things
id_str_rawwithSTRINGtype - will be used to remove deleted docs/idsEvent::MetadataChangedcallback to pass the deleted ids to thedeletefield ofupdate_tantivybuild_indexto compute deletedfixes #4061