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

Fix sort by vector query

ozanarmagan9cc8f8831080
diff --git a/include/field.h b/include/field.h
index 8cf4e773..0e55142f 100644
--- a/include/field.h
+++ b/include/field.h
@@ -572,6 +572,7 @@ struct sort_by {
missing_values = other.missing_values;
eval = other.eval;
reference_collection_name = other.reference_collection_name;
+ vector_query = other.vector_query;
}
sort_by& operator=(const sort_by& other) {
diff --git a/test/collection_sorting_test.cpp b/test/collection_sorting_test.cpp
index 366f2f93..deb6ad4f 100644
--- a/test/collection_sorting_test.cpp
+++ b/test/collection_sorting_test.cpp
@@ -2471,7 +2471,7 @@ TEST_F(CollectionSortingTest, InvalidVectorDistanceSorting) {
ASSERT_EQ("sort_by vector_distance is only supported for vector queries, semantic search and hybrid search.", results.error());
}
-TEST_F(CollectionSortingTest, DISABLED_TestSortByVectorQuery) {
+TEST_F(CollectionSortingTest, TestSortByVectorQuery) {
std::string coll_schema = R"(
{
"name": "coll1",