Limit text indexed for string sorting to prevent abuse.

This commit is contained in:
Kishore Nallan 2023-01-27 15:21:56 +05:30
parent bfb6e65764
commit f3d4bb4924
2 changed files with 3 additions and 5 deletions

View File

@ -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;

View File

@ -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));
}
}
}
}