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

<name>API distributed updates; QL uberpackets</name>

<config>
indexer
{
	mem_limit			= 16M
}

searchd
{
	<searchd_settings/>
	max_filter_values 	= 500000
	max_packet_size 	= 18M
	dist_threads			= 4
	read_timeout			= 1
	workers = threads
}

source src1
{
	type			= mysql
	<sql_settings/>

	sql_query		= SELECT id, group_id, title, mva FROM test_table
	sql_attr_uint	= group_id
	sql_attr_multi = uint mva from field
}

source src2 : src1
{
	sql_query		= SELECT 10+id, group_id, title, mva FROM test_table
}

source src_i1
{
	type			= mysql
	<sql_settings/>
	sql_query = SELECT id, title, group_id as gid FROM test_table
	sql_attr_uint	= gid
}

source src_i2
{
	type			= mysql
	<sql_settings/>
	sql_query = SELECT id + 100, title, group_id as gid FROM test_table
	sql_attr_uint	= gid
}
<agent0>
index block1
{
	source			= src1
	path			= <data_path/>/block1
	docinfo			= extern
	min_word_len	= 1
}
</agent0>

<agent1>
index block2
{
	source			= src2
	path			= <data_path/>/block2
	docinfo			= extern
	min_word_len	= 1
}

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

</agent1>

<agent0>
index dist
{
	type					= distributed
	local					= block1
	agent					= <agent_address/>:block2
	agent_connect_timeout	= 1000
	agent_query_timeout		= 3000
}

index dist2
{
	type					= distributed
	agent					= <agent_address/>:dist_agent_2
	agent_connect_timeout	= 1000
	agent_query_timeout		= 3000
}

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

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

index rt
{
	type = rt
	path			= <data_path/>/rt
	docinfo = extern
	rt_mem_limit = 128k
	rt_field		= title
	rt_attr_uint	= gid
}
</agent0>
</config>

<num_agents>2</num_agents>

<custom_test>
<![CDATA[
$results = array ();

$results[] = $client->XQuery ( "", "dist" );
$results[] = $client->XUpdateAttributes ( "dist", array("group_id"), array(11=>array(123)) );
$results[] = $client->XUpdateAttributes ( "dist", array("mva"), array ( 4=>array(array(1001, 1002)), 11=>array(array(1011, 1012)) ), true );
$results[] = $client->XQuery ( "", "dist" );

// here is going regression master fails to send 4k attributes to agent
$gid = array();
for ( $i=0; $i<50000; $i++ )
	$gid[] = $i;

$client->SetFilter ( 'group_id', $gid );
$results[] = $client->XQuery ( "", "dist2" );


// regression crash on SphinxQL packet overflow max_packet_size
$ql->Reconnect();
$results[] = $ql->Query ( "SHOW STATUS LIKE 'connections'" );
$results[] = $ql->Query ( "SHOW STATUS LIKE 'command_status'" );
$results[] = $ql->Query ( "SHOW STATUS LIKE 'queries'" );

$ids = "2";
for ( $i=3; $i<400000; $i++ )
	$ids .= "    ,      " . $i;
$ql->query ( "show meta IN ( group_id,1,$ids ) as c1, IN ( group_id,1,$ids ) as c2, IN ( group_id,1,$ids ) as c3" );

$ql->Reconnect();

$results[] = $ql->Query ( "SHOW STATUS LIKE 'connections'" );
$results[] = $ql->Query ( "SHOW STATUS LIKE 'command_status'" );
$results[] = $ql->Query ( "SHOW STATUS LIKE 'queries'" );
]]></custom_test>

<db_create>
CREATE TABLE test_table
(
	id			INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
	group_id	INTEGER NOT NULL,
	title		VARCHAR(255) NOT NULL,
	mva		VARCHAR(255) NOT NULL
);
</db_create>

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

<db_insert>
INSERT INTO test_table ( id, group_id, title, mva ) VALUES 
( 1, 1, 'test one', '10 11' ),
( 2, 1, 'test two', '10 11' ),
( 3, 2, 'test three', '10 11' ),
( 4, 2, 'test four', '10 11' )
</db_insert>

</test>