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 (227 lines) | stat: -rw-r--r-- 6,129 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
<?xml version="1.0" encoding="utf-8"?>
<test>

<name>like operator</name>

<config>
indexer
{
  mem_limit   = 16M
}

searchd
{
  <searchd_settings/>
  workers = threads
  predicted_time_costs = doc=100000000, hit=1000000, skip=0, match=0
}

source src
{
  type      = mysql
  <sql_settings/>
  sql_query     = SELECT document_id, group_id, group_id2, title, content FROM test_table
  sql_attr_uint   = group_id
  sql_attr_uint   = group_id2
}

index test
{
  source      = src
  path      = <data_path/>/test
}

source srchalf1
{
  type      = mysql
  <sql_settings/>
  sql_query     = SELECT 1, 11 idd, 'text goes here' text UNION SELECT 2, 11 idd, 'text goes there' text
  sql_attr_uint   = idd
}
source srchalf2
{
  type      = mysql
  <sql_settings/>
  sql_query     = SELECT 3, 11 idd, 'text everywhere but got text here' text UNION SELECT 4, 11 idd, 'got text hole' text
  sql_attr_uint   = idd
}

index loc1
{
  source      = srchalf1
  path      = <data_path/>/loc1
}
index loc2
{
  source      = srchalf2
  path      = <data_path/>/loc2
}
index d1
{
	type = distributed
	local = loc1
	agent = <my_address/>:loc2
}
index end1
{
	type = distributed
	agent = <my_address/>:loc1
	agent = <my_address/>:loc2
}
index proxy1
{
	type = distributed
	agent = <my_address/>:end1
}
index d2
{
	type = distributed
	agent = <my_address/>:proxy1
}
index d3
{
	type = distributed
	agent = <my_address/>:end1
}

source src10
{
  type      = mysql
  <sql_settings/>
  sql_query     = SELECT document_id, group_id, group_id2, title, content FROM test_table where document_id in (1,2)
  sql_attr_uint   = group_id
  sql_attr_uint   = group_id2
}

index test10
{
  source      = src10
  path      = <data_path/>/test10
}
source src11
{
  type      = mysql
  <sql_settings/>
  sql_query     = SELECT document_id, group_id, group_id2, title, content FROM test_table where document_id in (3,4)
  sql_attr_uint   = group_id
  sql_attr_uint   = group_id2
}

index test11
{
  source      = src11
  path      = <data_path/>/test11
}
index dist1
{
	type =distributed
	agent = <my_address/>:test10
	agent = <my_address/>:test11
}

source src20
{
  type      = mysql
  <sql_settings/>
  sql_query     = SELECT document_id, group_id, group_id2, title, content FROM test_table where document_id in (1,3)
  sql_attr_uint   = group_id
  sql_attr_uint   = group_id2
}

index test20
{
  source      = src20
  path      = <data_path/>/test20
}
source src21
{
  type      = mysql
  <sql_settings/>
  sql_query     = SELECT document_id, group_id, group_id2, title, content FROM test_table where document_id in (2,4)
  sql_attr_uint   = group_id
  sql_attr_uint   = group_id2
}

index test21
{
  source      = src21
  path      = <data_path/>/test21
}
index dist2
{
	type =distributed
	agent = <my_address/>:test20
	agent = <my_address/>:test21
}
</config>

<sphqueries>
<sphinxql>SHOW STATUS LIKE '%n_\_up%'</sphinxql>
<sphinxql>SHOW META LIKE '%al%found'</sphinxql>
<sphinxql>DESCRIBE test LIKE 'g_oup%'</sphinxql>
<sphinxql>SHOW TABLES LIKE '__s_'</sphinxql>
<sphinxql>SHOW AGENT STATUS LIKE '%seconds%'</sphinxql>

<sphinxql>SELECT *, GROUPBY(), COUNT(*) FROM test GROUP BY group_id, group_id2</sphinxql>
<sphinxql>SELECT *, GROUPBY(), COUNT(*) FROM test GROUP BY group_id2, group_id, group_id2</sphinxql>

<!-- regression fetched_docs, fetched_hits from (pure) distributed indexes -->
<sphinxql>SELECT * FROM loc1 WHERE MATCH ( 'text | got | here')  LIMIT 1 OPTION max_predicted_time=10000</sphinxql>
<sphinxql>SHOW META LIKE 'local%'</sphinxql>
<sphinxql>SHOW META LIKE 'dist%'</sphinxql>
<sphinxql>SHOW META LIKE '%predict%'</sphinxql>
<sphinxql>SELECT * FROM loc2 WHERE MATCH ( 'text | got | here')  LIMIT 1 OPTION max_predicted_time=10000</sphinxql>
<sphinxql>SHOW META LIKE 'local%'</sphinxql>
<sphinxql>SHOW META LIKE 'dist%'</sphinxql>
<sphinxql>SHOW META LIKE '%predict%'</sphinxql>
<sphinxql>SELECT * FROM loc1, loc2 WHERE MATCH ( 'text | got | here')  LIMIT 1 OPTION max_predicted_time=10000</sphinxql>
<sphinxql>SHOW META LIKE 'local%'</sphinxql>
<sphinxql>SHOW META LIKE 'dist%'</sphinxql>
<sphinxql>SHOW META LIKE '%predict%'</sphinxql>
<sphinxql>SELECT * FROM d1 WHERE MATCH ( 'text | got | here')  LIMIT 1 OPTION max_predicted_time=10000</sphinxql>
<sphinxql>SHOW META LIKE 'local%'</sphinxql>
<sphinxql>SHOW META LIKE 'dist%'</sphinxql>
<sphinxql>SHOW META LIKE '%predict%'</sphinxql>
<sphinxql>SELECT * FROM d2 WHERE MATCH ( 'text | got | here')  LIMIT 1 OPTION max_predicted_time=10000</sphinxql>
<sphinxql>SHOW META LIKE 'local%'</sphinxql>
<sphinxql>SHOW META LIKE 'dist%'</sphinxql>
<sphinxql>SHOW META LIKE '%predict%'</sphinxql>
<sphinxql>SELECT * FROM d3 WHERE MATCH ( 'text | got | here')  LIMIT 1 OPTION max_predicted_time=10000</sphinxql>
<sphinxql>SHOW META LIKE 'local%'</sphinxql>
<sphinxql>SHOW META LIKE 'dist%'</sphinxql>
<sphinxql>SHOW META LIKE '%predict%'</sphinxql>
<sphinxql>SELECT COUNT(*) FROM test</sphinxql>
<sphinxql>SELECT id id1, COUNT(DISTINCT id1) FROM test</sphinxql>

<!--regression group by multi vs distributed -->
<sphinxql>SELECT *, GROUPBY(), COUNT(*) FROM dist1 GROUP BY group_id, group_id2</sphinxql>
<sphinxql>SELECT *, GROUPBY(), COUNT(*) FROM dist1 GROUP BY group_id2, group_id, group_id2</sphinxql>
<sphinxql>SELECT *, GROUPBY(), COUNT(*) FROM dist2 GROUP BY group_id, group_id2</sphinxql>
<sphinxql>SELECT *, GROUPBY(), COUNT(*) FROM dist2 GROUP BY group_id2, group_id, group_id2</sphinxql>

</sphqueries>

<db_create>
CREATE TABLE test_table
(
  document_id INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
  group_id  INTEGER NOT NULL,
  group_id2 INTEGER NOT NULL,
  title   VARCHAR(255) NOT NULL,
  content   VARCHAR(255) NOT NULL
)
</db_create>

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

<db_insert>
INSERT INTO test_table ( document_id, group_id, group_id2, title, content ) VALUES
  ( 1, 1, 5, 'test one', 'this is my test document number one. also checking search within phrases.' ),
  ( 2, 1, 6, 'test two', 'this is my test document number two' ),
  ( 3, 2, 7, 'test three', 'this is another group' ),
  ( 4, 2, 8, 'test four', 'this is to test groups' )
</db_insert>

</test>