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

<name>expand keywords</name>

<config>
indexer
{
	mem_limit		= 16M
}

searchd
{
	<searchd_settings/>
	workers = threads
}

source srctest
{
	type			= mysql
	<sql_settings/>

	sql_query		= SELECT * FROM test_table
}

index test
{
	source			= srctest
	path			= <data_path/>/test
	morphology		= stem_en
	index_exact_words	= 1
	expand_keywords	= 1
}

source src_prefix
{
	type			= mysql
	<sql_settings/>

	sql_query		= SELECT 1, 'force all' UNION SELECT 2, 'forcing me' UNION SELECT 3, 'foam stuff'
}
index prefix
{
	source			= src_prefix
	path			= <data_path/>/prefix
	expand_keywords	= 1
	min_prefix_len = 2
}

index expanded_plain
{
	source			= srctest
	path			= <data_path/>/expanded-plain
	docinfo = extern
	dict = keywords
	expand_keywords	= 1
	min_infix_len = 3
}

index expanded_rt
{
	type = rt
	path			= <data_path/>/expanded-rt
	dict = keywords
	expand_keywords	= 1
	min_infix_len = 3
	rt_field = title
	rt_attr_uint = idd	
}

<!-- regression crash of daemon with empty dict=keywords and infixes enabled -->
source src_empty
{
        type                    = mysql
	<sql_settings/>
        sql_query               = SELECT * FROM empty_table
        sql_attr_uint           = uid
}
index empty
{
        type                    = plain
        path                    = <data_path/>/empty_kw
        source                  = src_empty
        min_infix_len           = 3
        dict                    = keywords
}

<!-- regression crash of daemon with docinfo=inline and dict=keywords -->
source src_inline
{
	type			= mysql
	<sql_settings/>

	sql_query		= SELECT *, document_id+100 as idd FROM test_table
	sql_attr_uint = idd
}

index plain_inline
{
	source			= src_inline
	path			= <data_path/>/plain-inline
	docinfo = inline
	dict = keywords
	min_prefix_len = 1
}

</config>

<queries>
<query mode="extended2" index="test">dog run</query>
<query mode="extended2" index="test">=dog =run</query>
<query mode="phrase" index="test">dog run</query>
<query mode="phrase" index="test">=dog =run</query>
<query mode="phrase" index="test">dog* run</query>
<!-- regression expand_keywords vs prefix -->
<query mode="extended2" index="prefix">for</query>
<query mode="extended2" index="prefix">fo</query>
<query mode="extended2" index="test">dog run</query>
<query mode="extended2" index="test">=dog =run</query>
<query mode="phrase" index="test">dog run</query>
<query mode="phrase" index="test">=dog =run</query>
<query mode="phrase" index="test">dog* run</query>
<!-- regression wrong word expansion -->
<query mode="extended2" index="expanded_plain">run</query>
<!-- regression crash of daemon with empty dict=keywords and infixes enabled -->
<query mode="extended2" index="empty">*dog*</query>
<!-- regression crash of daemon with docinfo=inline and dict=keywords -->
<query mode="extended2" index="plain_inline">run*</query>
</queries>

<sphqueries>
<sphinxql>insert into expanded_rt values ( 1,  'dog runs', 11 ), ( 2,  'dogs run', 22 ), ( 3,  'dogs running', 33 ), ( 4,  'dog run', 44 )</sphinxql>
<sphinxql>select * from expanded_rt where match ( 'run' )</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>select * from expanded_plain where match ( 'run' )</sphinxql>
<sphinxql>show meta</sphinxql>
</sphqueries>

<db_create>
CREATE TABLE `test_table`
(
	`document_id` int(11) NOT NULL default '0',
	`body` varchar(255) NOT NULL default ''
)
</db_create>
<db_create>
CREATE TABLE `empty_table`
(
	`document_id` int(11) NOT NULL default '0',
	`body` varchar(255) NOT NULL default ''
)
</db_create>

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

<db_insert>
INSERT INTO `test_table` VALUES
( 1,  'dog runs' ),
( 2,  'dogs run' ),
( 3,  'dogs running' ),
( 4,  'dog run' )
</db_insert>

</test>