mirror of
https://github.com/typesense/typesense.git
synced 2025-05-17 20:22:32 +08:00
Test for edge case of finding no query tokens in the array.
This commit is contained in:
parent
d58a6e613b
commit
d2dba44e5e
@ -669,6 +669,12 @@ TEST_F(CollectionTest, ArrayStringFieldHighlight) {
|
||||
ASSERT_STREQ(results["hits"][0]["highlights"][1]["snippet"].get<std::string>().c_str(),
|
||||
"<mark>Amazing</mark> Spiderman is <mark>amazing</mark>"); // should highlight duplicating tokens
|
||||
|
||||
// when query tokens are not found in an array field they should be ignored
|
||||
results = coll_array_text->search("winds", query_fields, "", facets, sort_fields, 0, 10, 1, FREQUENCY,
|
||||
false, 0).get();
|
||||
ASSERT_EQ(1, results["hits"].size());
|
||||
ASSERT_EQ(1, results["hits"][0]["highlights"].size());
|
||||
|
||||
collectionManager.drop_collection("coll_array_text");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user