File: test.xml

package info (click to toggle)
sphinxsearch 2.2.11-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 25,720 kB
  • sloc: cpp: 102,259; xml: 85,608; sh: 9,259; php: 3,790; ansic: 3,158; yacc: 1,969; java: 1,336; ruby: 1,289; python: 1,062; pascal: 912; perl: 381; lex: 275; makefile: 150; sql: 77; cs: 35
file content (418 lines) | stat: -rw-r--r-- 13,314 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
<?xml version="1.0" encoding="utf-8"?>
<test>

<name>index_exact_words</name>

<config>
indexer
{
	mem_limit		= 16M
}

searchd
{
	<searchd_settings/>
	workers = threads
}

source srctest
{
	type			= mysql
	<sql_settings/>
	sql_query		= SELECT document_id, body FROM test_table
}

index test
{
	source			= srctest
	path			= <data_path/>/test

	<dynamic>
		<variant>index_exact_words = 0</variant>
		<variant>index_exact_words = 1</variant>
	</dynamic>

	<dynamic>
		<variant>morphology = none</variant>
		<variant>morphology = stem_en</variant>
	</dynamic>
}

index rt
{
	type			= rt
	path			= <data_path/>/rt
	rt_field		= title	
	rt_attr_uint	= id1
	index_exact_words = 1
	morphology = stem_en
}

index rt_fix
{
	type			= rt
	path			= <data_path/>/rt_fix
	rt_field		= title	
	rt_attr_uint	= id1
	min_infix_len = 1
	dict = keywords
	morphology = stem_en
}

index wf
{
	source			= srctest
	path			= <data_path/>/wf
	dict = keywords
	index_exact_words = 1
	morphology = none
	wordforms		= <this_test/>/wordforms.txt
}

source src_stem : srctest
{
	sql_query		= SELECT 1 id, 11 idd, 'busy' title UNION SELECT 2 id, 11 idd, 'busi' title UNION SELECT 3 id, 11 idd, 'feet' title UNION SELECT 4 id, 11 idd, 'foot' title UNION SELECT 5 id, 11 idd, 'fbusy' title UNION SELECT 6 id, 11 idd, 'fbusi' title
	sql_attr_uint		= idd
}

index kw_p
{
	source			= src_stem
	path			= <data_path/>/kw_p
	charset_table = 0..9, a..z, A..Z->a..z
	dict = keywords
	min_prefix_len = 3
	morphology		= stem_en
	index_exact_words = 1
}

index kw_i
{
	source			= src_stem
	path			= <data_path/>/kw_i
	charset_table = 0..9, a..z, A..Z->a..z
	dict = keywords
	min_infix_len = 3
	morphology		= stem_en
	index_exact_words = 1
}

index rt_p
{
	type = rt
	path			= <data_path/>/rt_p
	rt_mem_limit = 128k
	rt_field                = title
	rt_attr_uint        = idd
	dict = keywords
	min_prefix_len = 3
	morphology		= stem_en
	index_exact_words = 1
}

index rt_i
{
	type = rt
	path			= <data_path/>/rt_i
	rt_mem_limit = 128k
	rt_field                = title
	rt_attr_uint        = idd
	dict = keywords
	min_infix_len = 3
	morphology		= stem_en
	index_exact_words = 1
}

source src_phrase : srctest
{
	sql_query		= SELECT 1 id, 11 idd, 'it running fast as you but can not' title UNION SELECT 2 id, 11 idd, 'as it runs me' title UNION SELECT 3 id, 11 idd, 'it run and has fun' title
	sql_attr_uint		= idd
}

index phrase_idx
{
	source			= src_phrase
	path			= <data_path/>/phrase_idx
	charset_table = 0..9, a..z, A..Z->a..z
	dict = keywords
	morphology		= stem_en
	index_exact_words = 1	
}

source src_phrase_shift : srctest
{
	sql_query		= SELECT 1 id, 11 idd, 'that orange box might be and not yellow' title UNION SELECT 2 id, 11 idd, 'however that is a green box always apears here as usual' title UNION SELECT 3 id, 11 idd, 'that orange box might be not yellow' title
	sql_attr_uint		= idd
}

index phrase_shift
{
	source			= src_phrase_shift
	path			= <data_path/>/phrase_shift
	charset_table = 0..9, a..z, A..Z->a..z
	dict = keywords
}

index phrase_shift_star
{
	source			= src_phrase_shift
	path			= <data_path/>/phrase_shift_star
	charset_table = 0..9, a..z, A..Z->a..z
	dict = keywords
	min_prefix_len = 1
}

index phrase_shift_min_wlen
{
	source			= src_phrase_shift
	path			= <data_path/>/phrase_shift_min_wlen
	charset_table = 0..9, a..z, A..Z->a..z
	dict = keywords
	min_word_len = 2
}

index phrase_shift_stop
{
	source			= src_phrase_shift
	path			= <data_path/>/phrase_shift_stop
	charset_table = 0..9, a..z, A..Z->a..z
	dict = keywords
	stopwords		= stopwords.txt
}

source src_4codepoint : srctest
{
       sql_query               = SELECT 1 id, 5 idd, CONCAT ( 'the boxed state ', REPEAT( CHAR(0xf3be80bb), 7  ) ) as title
       sql_attr_uint           = idd
}

index codepoint
{
       source                  = src_4codepoint
       path                    = <data_path/>/codepoint
       dict = keywords
       min_infix_len = 3
       morphology              = stem_en
       index_exact_words = 1
       enable_star = 1
       charset_type    = utf-8
}

source src_nostar1 : srctest
{
	sql_query		= SELECT 1 id, 11 idd, 'cool test' title
	sql_attr_uint		= idd
}

index plain_nostar1
{
	source			= src_nostar1
	path			= <data_path/>/plain_nostar1
	docinfo			= extern
	charset_table = 0..9, a..z, A..Z->a..z
	dict = keywords
	min_prefix_len = 0
	min_infix_len = 0
}

index rt_nostar1
{
	type = rt
	path			= <data_path/>/rt_nostar1
	docinfo = extern
	rt_mem_limit = 32M
	rt_attr_uint	= idd
	rt_field		= title
	charset_table = 0..9, a..z, A..Z->a..z
	dict = keywords
	min_prefix_len = 0
	min_infix_len = 0
}

index dist
{
	type = distributed
	local = plain_nostar1
	local = rt_nostar1
}

</config>

<queries>
<query mode="extended2" index="test">work</query>
<query mode="extended2" index="test">worked</query>
<query mode="extended2" index="test">worker</query>
<query mode="extended2" index="test">=work</query>
<query mode="extended2" index="test">=worked</query>
<query mode="extended2" index="test">=worker</query>
<query mode="extended2" index="test">run</query>
<query mode="extended2" index="test">runs</query>
<query mode="extended2" index="test">=run</query>
<query mode="extended2" index="test">=runs</query>
</queries>

<sphqueries>
<sphinxql>
REPLACE INTO rt (id, id1, title) VALUES ( 1, 1, 'work worked working workings worker works workers' ),
( 2, 1, 'run' ),
( 3, 1, 'runs' ),
( 4, 1, 'running' )
</sphinxql>
<sphinxql>SELECT * FROM rt WHERE MATCH('work')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt WHERE MATCH('worked')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt WHERE MATCH('worker')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt WHERE MATCH('=work')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt WHERE MATCH('=worked')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt WHERE MATCH('=worker')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt WHERE MATCH('run')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt WHERE MATCH('runs')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt WHERE MATCH('=run')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt WHERE MATCH('=runs')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>REPLACE INTO rt_fix (id, id1, title) VALUES ( 1, 1, 'hi people how are you' )</sphinxql>
<sphinxql>SELECT * FROM rt_fix WHERE MATCH('ho*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM wf WHERE MATCH('run')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM wf WHERE MATCH('runs')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM wf WHERE MATCH('=run')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM wf WHERE MATCH('=runs')</sphinxql>
<sphinxql>show meta</sphinxql>

<!--regression substring search at RT index -->
<sphinxql>REPLACE INTO rt_fix (id, id1, title) VALUES ( 2, 1, 'howdy all around' )</sphinxql>
<sphinxql>SELECT * FROM rt_fix WHERE MATCH('*eop*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt_fix WHERE MATCH('*ar*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt_fix WHERE MATCH('ho*')</sphinxql>
<sphinxql>show meta</sphinxql>

<!--regression substring search vs stemmed terms -->
<sphinxql>REPLACE INTO rt_p (id, idd, title) VALUES (1,11,'busy'), (2,11,'busi'), (3,11,'feet'), (4,11,'foot'), (5,11,'fbusy'), (6,11,'fbusi')</sphinxql>
<sphinxql>REPLACE INTO rt_i (id, idd, title) VALUES (1,11,'busy'), (2,11,'busi'), (3,11,'feet'), (4,11,'foot'), (5,11,'fbusy'), (6,11,'fbusi')</sphinxql>
<sphinxql>SELECT * FROM kw_p WHERE MATCH('busy*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM kw_i WHERE MATCH('busy*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt_p WHERE MATCH('busy*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt_i WHERE MATCH('busy*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM kw_p WHERE MATCH('busi*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM kw_i WHERE MATCH('busi*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt_p WHERE MATCH('busi*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt_i WHERE MATCH('busi*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM kw_i WHERE MATCH('*busy*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt_i WHERE MATCH('*busy*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM kw_i WHERE MATCH('*busi*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt_i WHERE MATCH('*busi*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM kw_p WHERE MATCH('foot*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM kw_i WHERE MATCH('foot*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt_p WHERE MATCH('foot*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt_i WHERE MATCH('foot*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM kw_p WHERE MATCH('feet*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM kw_i WHERE MATCH('feet*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt_p WHERE MATCH('feet*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt_i WHERE MATCH('feet*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM kw_i WHERE MATCH('*foot*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt_i WHERE MATCH('*foot*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM kw_i WHERE MATCH('*feet*')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM rt_i WHERE MATCH('*feet*')</sphinxql>
<sphinxql>show meta</sphinxql>

<!-- new feature exact phrase - just shortcut for all words in phrase have exact modifier -->
<sphinxql>SELECT * FROM phrase_idx WHERE MATCH(' "it run" ')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM phrase_idx WHERE MATCH(' ="it running" ')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM phrase_idx WHERE MATCH(' ="it runs" ')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>SELECT * FROM phrase_idx WHERE MATCH(' ="it run" ')</sphinxql>
<sphinxql>show meta</sphinxql>

<!-- phrase shift -->
<sphinxql>SELECT * FROM phrase_shift WHERE MATCH(' "that box" ')</sphinxql>
<sphinxql>SELECT * FROM phrase_shift WHERE MATCH(' "that * box" ')</sphinxql>
<sphinxql>SELECT * FROM phrase_shift WHERE MATCH(' "that * * * box" ')</sphinxql>
<sphinxql>SELECT * FROM phrase_shift WHERE MATCH(' "that * box might * * not yellow" ')</sphinxql>
<sphinxql>SELECT * FROM phrase_shift_star WHERE MATCH(' "that box" ')</sphinxql>
<sphinxql>SELECT * FROM phrase_shift_star WHERE MATCH(' "that * box" ')</sphinxql>
<sphinxql>SELECT * FROM phrase_shift_star WHERE MATCH(' "that * * * box" ')</sphinxql>
<sphinxql>SELECT * FROM phrase_shift_star WHERE MATCH(' "that * box might * * not yellow" ')</sphinxql>
<sphinxql>SELECT * FROM phrase_shift_min_wlen WHERE MATCH(' "that box" ')</sphinxql>
<sphinxql>SELECT * FROM phrase_shift_min_wlen WHERE MATCH(' "that * box" ')</sphinxql>
<sphinxql>SELECT * FROM phrase_shift_min_wlen WHERE MATCH(' "that * * * box" ')</sphinxql>
<sphinxql>SELECT * FROM phrase_shift_min_wlen WHERE MATCH(' "that * box might * * not yellow" ')</sphinxql>
<!-- regression crash on phrase shift with stopwords -->
<sphinxql>SELECT * FROM phrase_shift_stop WHERE MATCH(' "a the end that * box of" ')</sphinxql>
<sphinxql>SELECT * FROM phrase_shift WHERE MATCH(' "* * * box always" ')</sphinxql>
<sphinxql>SELECT * FROM phrase_shift_star WHERE MATCH(' "* * * box always" ')</sphinxql>
<sphinxql>SELECT * FROM phrase_shift_min_wlen WHERE MATCH(' "* * * box always" ')</sphinxql>

<!-- regression word with exact modifier that breaks infix builder -->
<sphinxql>REPLACE INTO rt_i (id, idd, title) VALUES (20,11,'long word ___________________________________________ that crashed')</sphinxql>
<sphinxql>FLUSH RAMCHUNK rt_i</sphinxql>

<!-- regression large codepoints vs infix builder -->
<sphinxql>SELECT * FROM codepoint WHERE MATCH('*box*')</sphinxql>

<!-- regression plain vs RT wildcard setup -->
<sphinxql>SELECT * FROM dist WHERE MATCH('test*')</sphinxql>
<sphinxql>SHOW META</sphinxql>
<sphinxql>CALL KEYWORDS ( 'test*', 'plain_nostar1')</sphinxql>
<sphinxql>CALL KEYWORDS ( 'test*', 'rt_nostar1')</sphinxql>

</sphqueries>

<db_create>
CREATE TABLE `test_table`
(
	`document_id` int(11) NOT NULL default '0',
	`body` varchar(255) NOT NULL default ''
)
</db_create>

<db_drop>
DROP TABLE IF EXISTS `test_table`
</db_drop>

<db_insert>
INSERT INTO `test_table` VALUES
( 1, 'work worked working workings worker works workers' ),
( 2, 'run' ),
( 3, 'runs' ),
( 4, 'running' )
</db_insert>

</test>