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
C++ algoliadatastoreelasticsearchenterprise-searchfacetingfull-text-searchfuzzy-searchgeosearchin-memoryinstantsearchmerchandisingpineconesearchsearch-enginesemantic-searchsimilarity-searchsite-searchsynonymstypo-tolerancevector-search
Add some comments to improve readability.
kishorenc8900347eed6e
diff --git a/include/field.h b/include/field.hindex e88b7c16..2d145ea1 100644--- a/include/field.h+++ b/include/field.h@@ -134,6 +134,7 @@ struct facet_value {spp::sparse_hash_map<std::string, uint32_t> value_index;spp::sparse_hash_map<uint32_t, std::string> index_value;+ // doc_id => facet_ids mappingspp::sparse_hash_map<uint32_t, std::vector<uint32_t>> doc_values;uint32_t get_value_index(const std::string & value) {diff --git a/src/index.cpp b/src/index.cppindex 89e8eb54..ce37a480 100644--- a/src/index.cpp+++ b/src/index.cpp@@ -523,7 +523,7 @@ void Index::do_facets(std::vector<facet> & facets, const uint32_t* result_ids, sfor(size_t i = 0; i < results_size; i++) {uint32_t doc_seq_id = result_ids[i];if(fvalue.doc_values.count(doc_seq_id) != 0) {- // for every result document, get the values associated and increment counter+ // for every result document, get the facet values and increment counterconst std::vector<uint32_t> & value_indices = fvalue.doc_values.at(doc_seq_id);for(size_t j = 0; j < value_indices.size(); j++) {const std::string & facet_value = fvalue.index_value.at(value_indices.at(j));diff --git a/src/sorted_array.cpp b/src/sorted_array.cppindex bd7d916c..228f6ba8 100644--- a/src/sorted_array.cpp+++ b/src/sorted_array.cpp@@ -125,6 +125,7 @@ void sorted_array::indexOf(const uint32_t *values, const size_t values_len, uintuint32_t low_index, high_index;uint32_t actual_value = 0;+ // identify the upper and lower bounds of the search spaceint head = -1;do {head++;@@ -145,6 +146,7 @@ void sorted_array::indexOf(const uint32_t *values, const size_t values_len, uintindices[j] = length;}+ // recursively search within the bounds for all valuesbinary_search_indices(values, head, tail, low_index, high_index, base, bits, indices);}