You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.info("========== Test Case 1: No Analyzer (omitNorms=true, no .nrm file) ==========")
57
+
58
+
// Test 1.1: BM25 match_any query on table without analyzer (no .nrm file)
59
+
qt_sql_no_omit_any """ SELECT request, score() as score FROM ${testTableNoOmitNorms} WHERE request MATCH_PHRASE_PREFIX 'GET /images/hm' ORDER BY score LIMIT 5; """
60
+
61
+
// Test 1.2: BM25 match_phrase query on table without analyzer (no .nrm file)
62
+
qt_sql_no_omit_phrase """ SELECT request, score() as score FROM ${testTableNoOmitNorms} WHERE request MATCH_PHRASE_PREFIX 'GET /images/' ORDER BY score LIMIT 5; """
63
+
64
+
// Test 1.3: BM25 match_all query on table without analyzer (no .nrm file)
65
+
qt_sql_no_omit_all """ SELECT request, score() as score FROM ${testTableNoOmitNorms} WHERE request MATCH_PHRASE_PREFIX 'POST' ORDER BY score LIMIT 5; """
66
+
67
+
// Test case 2: With analyzer - always create .nrm file
68
+
// When _should_analyzer = true, omitNorms is set to false, so .nrm file IS created
69
+
// Note: We use separate table for verification but don't use qt_sql to avoid output file issues
70
+
sql "DROP TABLE IF EXISTS ${testTableOmitNorms};"
71
+
sql """
72
+
CREATE TABLE ${testTableOmitNorms} (
73
+
`@timestamp` int(11) NULL COMMENT "",
74
+
`clientip` varchar(20) NULL COMMENT "",
75
+
`request` text NULL COMMENT "",
76
+
`status` int(11) NULL COMMENT "",
77
+
`size` int(11) NULL COMMENT "",
78
+
INDEX request_idx (`request`) USING INVERTED COMMENT ''
log.info("========== Test Case 2: With Analyzer (omitNorms=false, .nrm file created) ==========")
104
+
105
+
// Test 2.1: BM25 match_any query with analyzer (.nrm file created)
106
+
qt_sql_omit_any """ SELECT request, score() as score FROM ${testTableOmitNorms} WHERE request MATCH_PHRASE_PREFIX 'GET /images/hm' ORDER BY score LIMIT 5; """
107
+
108
+
// Test 2.2: BM25 match_phrase query with analyzer (.nrm file created)
109
+
qt_sql_omit_phrase """ SELECT request, score() as score FROM ${testTableOmitNorms} WHERE request MATCH_PHRASE_PREFIX 'GET /images/' ORDER BY score LIMIT 5; """
110
+
111
+
// Test 2.3: BM25 match_all query with analyzer (.nrm file created)
112
+
qt_sql_omit_all """ SELECT request, score() as score FROM ${testTableOmitNorms} WHERE request MATCH_PHRASE_PREFIX 'POST' ORDER BY score LIMIT 5; """
113
+
} finally {
114
+
// Disable fault injection after test (ignore errors)
0 commit comments