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

Limit text indexed for string sorting to prevent abuse.

Kishore Nallanf3d4bb492497
diff --git a/src/adi_tree.cpp b/src/adi_tree.cpp
index 056a994e..7deb9fdb 100644
--- a/src/adi_tree.cpp
+++ b/src/adi_tree.cpp
@@ -2,9 +2,6 @@
#include <vector>
#include "adi_tree.h"
#include "logger.h"
-#include <set>
-
-//std::set<adi_node_t*> nodes;
struct adi_node_t {
uint16_t num_children;
diff --git a/src/index.cpp b/src/index.cpp
index f3101f0d..94f084cd 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -1069,10 +1069,11 @@ void Index::index_field_in_memory(const field& afield, std::vector<index_record>
std::string raw_str = document[afield.name].get<std::string>();
Tokenizer str_tokenizer("", true, false, "", {' '});
- std::string processed_str;
str_tokenizer.tokenize(raw_str);
- str_tree->index(seq_id, raw_str);
+ if(!raw_str.empty()) {
+ str_tree->index(seq_id, raw_str.substr(0, 2000));
+ }
}
}
}