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

<name>Smart attribute updates</name>

<requires> <variant_match /> </requires>

<config>
indexer
{
	mem_limit		= 16M
}

searchd
{
	<searchd_settings/>
	workers = threads
	binlog_path = #
}

source src
{
	type			= mysql
	<sql_settings/>
	sql_query = SELECT id, text, section, mva1 FROM test_table WHERE id&lt;4
	sql_attr_uint	= section
<Dynamic>	
	<Variant>sql_attr_multi = uint mva1 from field mva1</Variant>
	<Variant>sql_attr_multi = bigint mva1 from field mva1</Variant>
</Dynamic>	
}

source src1 : src
{
	sql_query = SELECT id, text, section, mva1 FROM test_table WHERE id&lt;3
}

source src2 : src
{
	sql_query = SELECT id, text, section, mva1 FROM test_table WHERE id=3
}

index dist_no
{
	source			= src
	path			= <data_path/>/idx
	docinfo			= extern
	min_word_len	= 1
}

index idx1 : dist_no
{
	source			= src1
	path			= <data_path/>/idx1
}

index idx2 : dist_no
{
	source			= src2
	path			= <data_path/>/idx2
}

index dist0
{
	type					= distributed
	local					= dist_no
	agent_connect_timeout	= 1000
	agent_query_timeout		= 3000
}

index dist1
{
	type					= distributed
	local					= idx1
	local					= idx2
	agent_connect_timeout	= 1000
	agent_query_timeout		= 3000
}

index dist2
{
	type					= distributed
	agent					= <my_address/>:idx1
	local					= idx2
	agent_connect_timeout	= 1000
	agent_query_timeout		= 3000
}

index dist3
{
	type					= distributed
	local					= idx1
	agent					= <my_address/>:idx2
	agent_connect_timeout	= 1000
	agent_query_timeout		= 3000
}

index dist4
{
	type					= distributed
	agent					= <my_address/>:idx1
	agent					= <my_address/>:idx2
	agent_connect_timeout	= 1000
	agent_query_timeout		= 3000
}

index dist5
{
	type					= distributed
	agent					= <my_address/>:dist_no
	agent_connect_timeout	= 1000
	agent_query_timeout		= 3000
}

index rt
{
	type = rt
	path			= <data_path/>/rt
	docinfo			= extern

	rt_field			= body
	rt_attr_multi	= mva1
	rt_attr_uint	= gid
	rt_attr_multi	= mva2
}

</config>

<sphqueries>
<sphinxql>insert into rt (id, gid, mva1, mva2, body) values (1, 11, (1, 1), (2), 'dummy'), (3, 33, (3, 3), (3), 'dummy1')</sphinxql>
<sphinxql>update dist_no set mva1=(3,2, 1, 2), mva1=(1, 2), section=111 where match ('test1')</sphinxql>
<sphinxql>select * from dist_no</sphinxql>
<sphinxql>update dist0 set mva1=(4,5, 1, 2), mva1=(8, 7), section=112 where match ('test1')</sphinxql>
<sphinxql>select * from dist0</sphinxql>
<sphinxql>update dist1 set mva1=(3,2, 1, 2), mva1=(9, 10), section=113 where match ('testt') and id>=2</sphinxql>
<sphinxql>select * from dist1</sphinxql>
<sphinxql>update dist2 set mva1=(3,2, 1, 2), mva1=(11, 12), section=114 where match ('testt') and id>=2</sphinxql>
<sphinxql>select * from dist2</sphinxql>
<sphinxql>update dist3 set mva1=(3,2, 1, 2), mva1=(13, 14), section=115 where gid match ('testt') and id>=2</sphinxql>
<sphinxql>select * from dist3</sphinxql>
<sphinxql>update dist4 set mva1=(3,2, 1, 2), mva1=(15, 16), section=116 where match ('testt') and id>=2</sphinxql>
<sphinxql>select * from dist4</sphinxql>
<sphinxql>update dist5 set mva1=(3,2, 1, 2), mva1=(17, 18), section=117 where match ('testt') and id>=2</sphinxql>
<sphinxql>select * from dist5</sphinxql>
<sphinxql>update rt set mva1=(3,2, 1, 2), gid=3212, mva2=(1, 2, 3, 4, 5, 6), mva2=(3,4,5) where id=1</sphinxql>
<sphinxql>select * from rt</sphinxql>
<sphinxql>update rt set mva1=() where id=3</sphinxql>
<sphinxql>select * from rt</sphinxql>
</sphqueries>

  <DB_Create>
CREATE TABLE `test_table` (
  `id` int(11) DEFAULT NULL,
  `text` varchar (255) NOT NULL,
  `section` int(11) DEFAULT NULL,
  `mva1` varchar(255) NOT NULL  
)
  </DB_Create>

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

  <DB_Insert>
INSERT INTO `test_table` (`id`, `text`, `section`, `mva1`) VALUES 
(1, 'test test1', 101, '1001'),
(2, 'testt test2', 102, '1002 1023 4456'),
(3, 'test test3', 103, '1003 1008 1010'),
(4, 'testt test4', 104, '1004 1005 1006');
  </DB_Insert>
  
</test>