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.26-facets

Kishore Nallanbfa744353bed
diff --cc src/index.cpp
index 1b18d871,84e9f6ed..6c3d2601
--- a/src/index.cpp
+++ b/src/index.cpp
@@@ -5886,25 -6315,15 +5886,26 @@@ size_t Index::num_seq_ids() const
Option<bool> Index::seq_ids_outside_top_k(const std::string& field_name, size_t k,
std::vector<uint32_t>& outside_seq_ids) {
+ std::shared_lock lock(mutex);
- auto field_it = numerical_index.find(field_name);
+ if (numerical_index.count(field_name) != 0) {
+ auto field_it = numerical_index.find(field_name);
+
+ if(field_it == sort_index.end()) {
+ return Option<bool>(400, "Field not found in numerical index.");
+ }
+
+ field_it->second->seq_ids_outside_top_k(k, outside_seq_ids);
- if(field_it == numerical_index.end()) {
- return Option<bool>(400, "Field not found in numerical index.");
+ return Option<bool>(true);
}
- field_it->second->seq_ids_outside_top_k(k, outside_seq_ids);
- return Option<bool>(true);
+ if (range_index.count(field_name) != 0) {
+ auto trie = range_index[field_name];
+ trie->seq_ids_outside_top_k(k, outside_seq_ids);
+ return Option<bool>(true);
+ }
+
+ return Option<bool>(400, "Field `" + field_name + "` not found in numerical index.");
}
void Index::resolve_space_as_typos(std::vector<std::string>& qtokens, const string& field_name,