diff --git a/src/collection.cpp b/src/collection.cpp index ab438dfb..8e306221 100644 --- a/src/collection.cpp +++ b/src/collection.cpp @@ -1352,7 +1352,9 @@ void Collection::parse_search_query(const std::string &query, std::vector fields = {field("title", field_types::STRING, false), + field("points", field_types::INT32, false),}; + + Collection* coll1 = collectionManager.create_collection("coll1", 1, fields, "points").get(); + + nlohmann::json doc1; + doc1["id"] = "0"; + doc1["title"] = "Saturday Short - Thrive (with Audio Descriptions + Open Captions)"; + doc1["points"] = 100; + + ASSERT_TRUE(coll1->add(doc1.dump()).ok()); + + auto results = coll1->search("Saturday Short - Thrive (with Audio Descriptions + Open Captions)", {"title"}, + "", {}, {}, {2}, 10, + 1, FREQUENCY, {true}, + 10, spp::sparse_hash_set(), + spp::sparse_hash_set(), 10, "", 30, 4, "title", 20, {}, {}, {}, 0, + "", "", {}, 1000, true).get(); + + ASSERT_EQ(1, results["hits"].size()); + collectionManager.drop_collection("coll1"); +}