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

Use doc_field_it

ozanarmagandce27b918ef4
diff --git a/src/index.cpp b/src/index.cpp
index 22a34b0d..7192faba 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -6500,9 +6500,9 @@ void Index::batch_embed_fields(std::vector<index_record*>& records,
continue;
}
if(field_it.value().type == field_types::STRING) {
- text += (*document)[field_name].get<std::string>() + " ";
+ text += doc_field_it->get<std::string>() + " ";
} else if(field_it.value().type == field_types::STRING_ARRAY) {
- for(const auto& val : (*document)[field_name]) {
+ for(const auto& val : *(doc_field_it)) {
text += val.get<std::string>() + " ";
}
}