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 (206 lines) | stat: -rw-r--r-- 5,583 bytes parent folder | download | duplicates (5)
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
<test>
<name>field position limit vs many hits</name>

<config>
indexer
{
	mem_limit = 16M
}

searchd
{
	<searchd_settings/>
	workers = threads
}

source test
{
	type = mysql
	<sql_settings/>
	sql_query = SELECT * FROM test_table
	sql_attr_uint	= idd
	sql_file_field	= body
}

index test
{
	source			= test
	path			= <data_path/>/test
	docinfo			= extern
	
	html_strip		= 1	
	index_sp		= 1
	index_zones		= zone*
}

source start_end
{
	type = mysql
	<sql_settings/>
	sql_query = SELECT id, body, 1 as idd FROM start_end_table
	sql_attr_uint	= idd
	sql_field_string	= body
}

index start_end
{
	source			= start_end
	path			= <data_path/>/start_end
	docinfo			= extern
}

source src_1
{
	type = mysql
	<sql_settings/>
	sql_query = SELECT 1 as id, 'Footpath' as title, 'Republic of Ireland' as country
	sql_field_string	= title
	sql_field_string	= country
}

index i1
{
	source			= src_1
	path			= <data_path/>/i1
	docinfo			= extern
	min_word_len = 1
	morphology = stem_en
	index_exact_words = 1
}

source src_fl
{
	type = mysql
	<sql_settings/>
	sql_query = SELECT 1 as id, 'we are from here' as title, 'but live there all the time' as body UNION SELECT 2 as id, 'but live there all the time' as title, 'we are from here' as body
	sql_field_string	= title
	sql_field_string	= body
}

index fl
{
	source			= src_fl
	path			= <data_path/>/fl
	docinfo			= extern
}

source src_blend
{
	type = mysql
	<sql_settings/>
	sql_query = SELECT 1 as id, 'dummy1 dummy1 dummy1 dummy1 X-COM' as title, 'dummy1 dummy1, dummy1, dummy1 dummy1 dummy1 valid dummy1 dummy1 dummy1 X-COM, dummy1' as body
	sql_field_string	= title
	sql_field_string	= body
}

index idx_blend_crc
{
	source			= src_blend
	path			= <data_path/>/idx_blend_crc
	docinfo			= extern
	
	morphology		= stem_enru
	min_prefix_len	= 3
	enable_star		= 1
	index_exact_words	= 1
	blend_mode		= trim_head, trim_tail, trim_both
	blend_chars 	= +, %, -
	dict = crc	
}

index idx_blend_kw
{
	source			= src_blend
	path			= <data_path/>/idx_blend_kw
	docinfo			= extern
	
	morphology		= stem_enru
	min_prefix_len	= 3
	enable_star		= 1
	index_exact_words	= 1
	blend_mode		= trim_head, trim_tail, trim_both
	blend_chars 	= +, %, -
	dict			= keywords
}

index rt
{
	type = rt
	path			= <data_path/>/rt
	docinfo = extern
	rt_mem_limit = 128k
	rt_attr_uint	= idd
	rt_field = title
	rt_field = description
	dict = keywords
}
</config>

<db_create>
CREATE TABLE test_table
(
	id INT NOT NULL,
	body VARCHAR(2048) NOT NULL,
	idd INT NOT NULL
);
</db_create>
<db_create>
CREATE TABLE start_end_table
(
	id INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
	body VARCHAR(64) NOT NULL
);
</db_create>

<db_drop>drop table if exists test_table;</db_drop>
<db_drop>drop table if exists start_end_table;</db_drop>

<db_insert>insert into test_table values ( 1, 'test_148/doc1.txt', 1 );</db_insert>
<db_insert>insert into test_table values ( 2, 'test_148/doc2.txt', 2 );</db_insert>
<db_insert>insert into test_table values ( 3, 'test_148/doc3.txt', 3 );</db_insert>

<sphqueries>
	<sphinxql>select * from test where match ('ZONE:zoneA dummy')</sphinxql>
	<sphinxql>select * from test where match ('@body[1024] text')</sphinxql>
	<sphinxql>select * from test where match ('@body[1024] dummy')</sphinxql>
	<sphinxql>select * from start_end where match ('@body ABB') group by idd</sphinxql>
	<sphinxql>select * from start_end where match ('@body ^ABB') group by idd</sphinxql>
	<sphinxql>select * from start_end where match ('@body ABB$') group by idd</sphinxql>
	<sphinxql>select * from start_end where match ('@body ^ABB$') group by idd</sphinxql>
	<!-- regression of field end marker at exact term -->
	<sphinxql>select * from i1 where match (' "=Republic =of =Ireland" ')</sphinxql>
	<sphinxql>select * from i1 where match (' "^=Republic =of =Ireland" ')</sphinxql>
	<sphinxql>select * from i1 where match (' "=Republic =of =Ireland$" ')</sphinxql>
	<sphinxql>select * from i1 where match (' "^=Republic =of =Ireland$" ')</sphinxql>
	<sphinxql>select * from i1 where match (' =Footpath$ ')</sphinxql>
	<sphinxql>select * from i1 where match (' ^=Footpath$ ')</sphinxql>
	
	<!-- regression of field limit propagation -->
	<sphinxql>select * from fl where match (' (@title we) live ')</sphinxql>
	<sphinxql>select * from fl where match (' (@title we are) (@body live there) from time ')</sphinxql>
	<sphinxql>select * from fl where match (' are (@body we) from time ')</sphinxql>
	<sphinxql>select * from fl where match (' are (@body we) from (@title time the) here ')</sphinxql>
	
	<!-- regression of field end marker vs blended -->
	<sphinxql>select * from idx_blend_crc where match (' x-com NEAR/10 valid')</sphinxql>
	<sphinxql>select * from idx_blend_kw where match (' x-com NEAR/10 valid ')</sphinxql>
	<sphinxql>CALL SNIPPETS ( 'dummy1 dummy1 valid dummy1 dummy1 dummy1 X-COM, dummy1', 'idx_blend_kw', 'x-com NEAR/10 valid', 1 as query_mode )</sphinxql>
	
	<!-- regression of field position limit vs RT index -->
	<sphinxql>REPLACE INTO rt (id, title, description) VALUES (1, 'This is a simple test', 'This is a longer description of a simple test')</sphinxql>
	<sphinxql>SELECT id FROM rt WHERE MATCH('@description test')</sphinxql>
	<sphinxql>SELECT id FROM rt WHERE MATCH('@description[10] test')</sphinxql>
	
</sphqueries>

<custom_insert><![CDATA[

for ( $i=0; $i<98; ++$i )
	mysql_query ( "insert into start_end_table (body) values ('ABB')" );
mysql_query ( "insert into start_end_table (body) values ('ABB abc ABB')" );
for ( $i=0; $i<501; ++$i )
	mysql_query ( "insert into start_end_table (body) values ('ABB')" );

]]></custom_insert>

</test>