diff --git a/include/index.h b/include/index.h index 76ca3696..19bfc902 100644 --- a/include/index.h +++ b/include/index.h @@ -538,10 +538,6 @@ private: static Option embed_fields(nlohmann::json& document, const tsl::htrie_map& embedding_fields, const tsl::htrie_map & search_schema); - - static Option embed_fields_update(const nlohmann::json& old_doc, nlohmann::json& new_doc, - const tsl::htrie_map& embedding_fields, - const tsl::htrie_map & search_schema); public: // for limiting number of results on multiple candidates / query rewrites diff --git a/src/index.cpp b/src/index.cpp index 0b59c823..cf5a49d3 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -6287,37 +6287,6 @@ Option Index::embed_fields(nlohmann::json& document, return Option(true); } - -Option Index::embed_fields_update(const nlohmann::json& old_doc, nlohmann::json& new_doc, - const tsl::htrie_map& embedding_fields, - const tsl::htrie_map & search_schema) { - nlohmann::json new_doc_copy = new_doc; - for(const auto& field : embedding_fields) { - std::string text_to_embed; - for(const auto& field_name : field.embed_from) { - auto field_it = search_schema.find(field_name); - nlohmann::json value = (new_doc.find(field_name) != new_doc.end()) ? new_doc[field_name] : old_doc[field_name]; - if(field_it.value().type == field_types::STRING) { - text_to_embed += value.get() + " "; - } else if(field_it.value().type == field_types::STRING_ARRAY) { - for(const auto& val : value) { - text_to_embed += val.get() + " "; - } - } - } - - TextEmbedderManager& embedder_manager = TextEmbedderManager::get_instance(); - auto embedder = embedder_manager.get_text_embedder(field.model_name.size() > 0 ? field.model_name : TextEmbedderManager::DEFAULT_MODEL_NAME); - std::vector embedding = embedder->Embed(text_to_embed); - new_doc_copy[field.name] = embedding; - } - new_doc = new_doc_copy; - return Option(true); -} - - - - /* // https://stackoverflow.com/questions/924171/geo-fencing-point-inside-outside-polygon // NOTE: polygon and point should have been transformed with `transform_for_180th_meridian`