Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Merge branch 'v0.25-join' into v0.25-join

Ozan Armağan0f5abfc5fa0f
diff --cc src/index.cpp
index 76d80fcb,66a1470d..08ac0786
--- a/src/index.cpp
+++ b/src/index.cpp
@@@ -451,17 -450,13 +451,18 @@@ void Index::validate_and_preprocess(Ind
if(index_rec.is_update) {
// scrub string fields to reduce delete ops
- get_doc_changes(index_rec.operation, index_rec.doc, index_rec.old_doc, index_rec.new_doc,
- index_rec.del_doc);
+ get_doc_changes(index_rec.operation, search_schema, index_rec.doc, index_rec.old_doc,
+ index_rec.new_doc, index_rec.del_doc);
scrub_reindex_doc(search_schema, index_rec.doc, index_rec.del_doc, index_rec.old_doc);
- embed_fields(index_rec.new_doc, embedding_fields, search_schema);
+ for(auto& field: index_rec.doc.items()) {
+ if(embedding_fields.find(field.key()) != embedding_fields.end()) {
+ docs_to_embed.push_back(&index_rec.doc);
+ break;
+ }
+ }
} else {
- docs_to_embed.push_back(&index_rec.doc);
+ handle_doc_ops(search_schema, index_rec.doc, index_rec.old_doc);
+ embed_fields(index_rec.doc, embedding_fields, search_schema);
}
compute_token_offsets_facets(index_rec, search_schema, token_separators, symbols_to_index);