Skip to content

Commit 3a10b44

Browse files
Add initial csv test
1 parent e3d4f60 commit 3a10b44

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
###############################################
2+
# Tests for MultiMatch function
3+
#
4+
5+
multiMatchWithField
6+
required_capability: multi_match_function
7+
8+
// tag::multi-match-with-field[]
9+
FROM books
10+
| WHERE MULTI_MATCH("Faulkner", "author", "summary", {"fuzziness": 1})
11+
| KEEP book_no, author
12+
| SORT book_no
13+
| LIMIT 5
14+
// end::multi-match-with-field[]
15+
;
16+
17+
// tag::multi-match-with-field-result[]
18+
book_no:keyword | author:text
19+
2378 | [Carol Faulkner, Holly Byers Ochoa, Lucretia Mott]
20+
2713 | William Faulkner
21+
2847 | Colleen Faulkner
22+
2883 | William Faulkner
23+
3293 | Danny Faulkner
24+
// end::multi-match-with-field-result[]
25+
;
26+
27+
testMultiMatchWithOptionsFuzziness
28+
required_capability: multi_match_function
29+
30+
from books
31+
| where multi_match("Pings", "title", "summary", {"fuzziness": 1})
32+
| keep book_no;
33+
ignoreOrder:true
34+
35+
book_no:keyword
36+
2714
37+
2675
38+
4023
39+
7140
40+
;
41+
42+
testMultiMatchWithOptionsOperator
43+
required_capability: multi_match_function
44+
45+
// tag::multi-match-with-named-function-params[]
46+
FROM books
47+
| WHERE MULTI_MATCH("Hobbit Back Again", "title", "summary", {"operator": "AND"})
48+
| KEEP title;
49+
// end::multi-match-with-named-function-params[]
50+
51+
// tag::multi-match-with-named-function-params-result[]
52+
title:text
53+
The Hobbit or There and Back Again
54+
// end::multi-match-with-named-function-params-result[]
55+
;
56+
57+
testMultiMatchWithOptionsMinimumShouldMatch
58+
required_capability: multi_match_function
59+
60+
from books
61+
| where multi_match("Hobbit Back Again", "title", "summary", {"minimum_should_match": 2})
62+
| keep title;
63+
64+
title:text
65+
The Hobbit or There and Back Again
66+
;
67+
68+
testMultiMatchWithNonPushableDisjunctions
69+
required_capability: multi_match_function
70+
required_capability: full_text_functions_disjunctions_compute_engine
71+
72+
from books
73+
| where multi_match("lord", "title", "summary", {}) or length(title) > 130
74+
| keep book_no
75+
;
76+
ignoreOrder: true
77+
78+
book_no:keyword
79+
2675
80+
2714
81+
4023
82+
7140
83+
8678
84+
;

0 commit comments

Comments
 (0)