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

Return range_index property when enabled.

Kishore Nallan9c0ca02812e4
diff --git a/src/collection.cpp b/src/collection.cpp
index ea0ce887..031c7d5a 100644
--- a/src/collection.cpp
+++ b/src/collection.cpp
@@ -466,6 +466,11 @@ nlohmann::json Collection::get_summary_json() const {
field_json[fields::infix] = coll_field.infix;
field_json[fields::locale] = coll_field.locale;
field_json[fields::stem] = coll_field.stem;
+
+ if(coll_field.range_index) {
+ field_json[fields::range_index] = coll_field.range_index;
+ }
+
// no need to sned hnsw_params for text fields
if(coll_field.num_dim > 0) {
field_json[fields::hnsw_params] = coll_field.hnsw_params;
diff --git a/test/numeric_range_trie_test.cpp b/test/numeric_range_trie_test.cpp
index 92bf01cc..4636725b 100644
--- a/test/numeric_range_trie_test.cpp
+++ b/test/numeric_range_trie_test.cpp
@@ -947,4 +947,8 @@ TEST_F(NumericRangeTrieTest, Integration) {
results = coll_array_fields->search("Jeremy", query_fields, "rating: [7.812 .. 9.999, 1.05 .. 1.09]", facets, sort_fields, {0}, 10, 1, FREQUENCY, {false}).get();
ASSERT_EQ(3, results["hits"].size());
+
+ auto coll_json = coll_array_fields->get_summary_json();
+ ASSERT_TRUE(coll_json["fields"][2]["range_index"]);
+ ASSERT_TRUE(coll_json["fields"][4]["range_index"]);
}