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

<name>table functions (REMOVE_REPEATS etc)</name>

<requires>
<variant_match/>
</requires>  

<config>
indexer
{
	mem_limit		= 16M
}

searchd
{
	<searchd_settings/>
	workers = threads
	<dynamic>
		<variant>dist_threads = 0</variant>
		<variant>dist_threads = 4</variant>
	</dynamic>
}

source test1
{
	type			= mysql
	<sql_settings/>
	sql_query		= select *, 1 iid from test_table where (id%2)=1
	sql_attr_uint	= gid
	sql_attr_uint	= iid
}

source test2 : test1
{
	sql_query		= select *, 2 iid from test_table where (id%2)=0
}

index test1
{
	source			= test1
	path			= <data_path/>/test1
}

index test2
{
	source			= test2
	path			= <data_path/>/test2
}

index dist1
{
	type = distributed
	local = test1
	local = test2
}

index dist2
{
	type = distributed
	agent = <my_address/>:test1
	agent = <my_address/>:test2
}

index rt_killlist
{
	type = rt
	path = <data_path/>/rt_killlist
	rt_field = text
	rt_attr_uint = gid
}
</config>

<db_create>
CREATE TABLE test_table
(
	id INTEGER PRIMARY KEY NOT NULL,
	gid INTEGER NOT NULL,
	title VARCHAR(255) NOT NULL
);
</db_create>
<db_drop>DROP TABLE IF EXISTS test_table;</db_drop>
<db_insert>INSERT INTO test_table VALUES
( 1, 1, 'test one' ),
( 2, 1, 'test two' ),
( 3, 1, 'test three' ),
( 4, 1, 'test four' ),
( 5, 1, 'test five' ),
( 6, 1, 'six' ),
( 7, 1, 'seven' ),
( 8, 1, 'eight' ),
( 9, 1, 'nine' ),
( 10, 1, 'ten' );
</db_insert>

<sphqueries>
<sphinxql>select remove_repeats((select * from dist1), gid, 0, 10)</sphinxql>
<sphinxql>select remove_repeats((select * from dist1), iid, 0, 10)</sphinxql>
<sphinxql>select * from dist1 where match('one|three|four|five') order by id asc</sphinxql>
<sphinxql>select remove_repeats((select * from dist1 where match('one|three|four|five') order by id asc), iid, 0, 10)</sphinxql>
<sphinxql>select remove_repeats((select * from dist1 where match('one|three|four|five') order by id asc), iid, 0, 2)</sphinxql>
<sphinxql>select remove_repeats((select * from dist2 where match('one|three|four|five') order by id asc), iid, 0, 10)</sphinxql>
<sphinxql>select remove_repeats((select * from dist2 where match('one|three|four|five') order by id asc), iid, 0, 2)</sphinxql>
<sphinxql>select * from (select *, weight() w from dist2 where match('test') order by id asc) order by w desc</sphinxql>
<sphinxql>select remove_repeats((select * from (select *, weight() w from dist2 where match('test') order by id asc) order by w desc), iid, 0, 2)</sphinxql>

<!-- incorrect kill list handling (duplicates in result set) test -->
<sphinxql>REPLACE INTO rt_killlist VALUES (1, 'asdf', 11)</sphinxql>
<sphinxql>FLUSH RAMCHUNK rt_killlist</sphinxql>
<sphinxql>REPLACE INTO rt_killlist VALUES (1, 'asdf', 11)</sphinxql>
<sphinxql>FLUSH RAMCHUNK rt_killlist</sphinxql>
<sphinxql>REPLACE INTO rt_killlist VALUES (1, 'asdf', 11)</sphinxql>
<sphinxql>FLUSH RAMCHUNK rt_killlist</sphinxql>
<sphinxql>SELECT * FROM rt_killlist</sphinxql>
</sphqueries>

</test>