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
allow integer val for geopoint (#1773)
Krunal Gandhib4b399a4b7ee
diff --git a/src/field.cpp b/src/field.cppindex 491190f6..4015bbc8 100644--- a/src/field.cpp+++ b/src/field.cpp@@ -566,7 +566,11 @@ Option<bool> field::flatten_field(nlohmann::json& doc, nlohmann::json& obj, cons(detected_type == field_types::FLOAT_ARRAY && the_field.type == field_types::GEOPOINT_ARRAY) ||- (detected_type == field_types::FLOAT_ARRAY && the_field.type == field_types::GEOPOINT && !has_obj_array)+ (detected_type == field_types::FLOAT_ARRAY && the_field.type == field_types::GEOPOINT && !has_obj_array) ||++ (detected_type == field_types::INT64_ARRAY && the_field.type == field_types::GEOPOINT && !has_obj_array) ||++ (detected_type == field_types::INT64_ARRAY && the_field.type == field_types::GEOPOINT_ARRAY));if(detected_type == the_field.type || is_numericaly_valid) {diff --git a/test/collection_nested_fields_test.cpp b/test/collection_nested_fields_test.cppindex 6f783f73..503f9034 100644--- a/test/collection_nested_fields_test.cpp+++ b/test/collection_nested_fields_test.cpp@@ -2024,6 +2024,19 @@ TEST_F(CollectionNestedFieldsTest, NestedFieldWithGeopoint) {ASSERT_EQ(1, results["found"].get<size_t>());// data validation+ //with integer values+ doc1 = R"({"address": {"geoPoint": [19, 72.88261]}})"_json;+ add_op = coll1->add(doc1.dump(), CREATE);+ ASSERT_TRUE(add_op.ok());++ doc1 = R"({"address": {"geoPoint": [19.12, 72]}})"_json;+ add_op = coll1->add(doc1.dump(), CREATE);+ ASSERT_TRUE(add_op.ok());++ doc1 = R"({"address": {"geoPoint": [19, 72]}})"_json;+ add_op = coll1->add(doc1.dump(), CREATE);+ ASSERT_TRUE(add_op.ok());+auto bad_doc = R"({"address": {"geoPoint": [1.91, "x"]}})"_json;