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

<requires>
<lemmatizer_base/>
</requires>

<name>cooperation of index_exact_word with expanding by lematizer, expand</name>

<config>
common
{
	lemmatizer_base	= <local>lemmatizer_base</local>
}

searchd
{
	<searchd_settings/>
	workers				= threads
}

source test1
{
	type			= mysql
	<sql_settings/>
	sql_query_pre	= set names utf8
	sql_query		= select * from test_table
	sql_attr_uint	= gid
}

# test with wordforms
index testw
{
	source			= test1
	dict			= keywords
	min_infix_len	= 2
	path			= <data_path/>/testw
	blend_chars		= @, .
	wordforms		= <this_test/>/wordforms.txt
}

# test with wordworms and index_exact
index testwe : testw
{
	path			= <data_path/>/testwe
	index_exact_words = 1
}

# test with crc dict
index testc : testw
{
	path			= <data_path/>/testc
	dict = crc
}

# test with crc dict and index_exact_words
index testce : testc
{
	path			= <data_path/>/testce
	index_exact_words = 1
}

# test with lemmatize_all
index testla
{
	source			= test1
	path			= <data_path/>/testla
	morphology		= lemmatize_ru_all
	blend_chars		= @, .
	wordforms		= <this_test/>/wordforms.txt
}

# test with lemmatize
index testl : testla
{
	path			= <data_path/>/testl
	morphology		= lemmatize_ru
}

# test with lemmatize_all and index_exact_words
index testlae : testla
{
	path			= <data_path/>/testlae
	index_exact_words = 1
	morphology		= stem_en,lemmatize_ru_all
}

# test prefixed
index testpr
{
	source			= test1
	path			= <data_path/>/testpr
	expand_keywords	= 1
	min_prefix_len	= 2
}

# test plain expanded index
index testple
{
	source			= test1
	path			= <data_path/>/testple
	docinfo			= extern
	dict			= keywords
	expand_keywords	= 1
	min_infix_len	= 2
}

source src_plain_ckw
{
	type			= mysql
	<sql_settings/>
	sql_query_pre	= set names utf8
	sql_query		= select 1 as id, 11 as idd, 'фичин баг, но не фичина бага' as title
	sql_attr_uint	= idd
}

index plain_ckw
{
	source			= src_plain_ckw
	dict			= keywords
	path			= <data_path/>/plain_ckw
	morphology		= lemmatize_en_all, lemmatize_ru_all
}

index rt_ckw
{
    type            = rt
    dict            = keywords
    path            = <data_path/>/rt_ckw
    rt_attr_uint    = idd
    rt_field        = title
	morphology		= lemmatize_en_all, lemmatize_ru_all
}


index tmpl_ckw
{
	type			= template
	dict			= keywords
	morphology		= lemmatize_en_all, lemmatize_ru_all
}

</config>

<db_create>
CREATE TABLE test_table
(
	id INTEGER PRIMARY KEY NOT NULL,
	gid INTEGER NOT NULL,
	title VARCHAR(255) CHARACTER SET utf8 NOT NULL
);
</db_create>
<db_drop>DROP TABLE IF EXISTS test_table</db_drop>
<db_insert>SET NAMES utf8</db_insert>
<db_insert>INSERT INTO test_table VALUES
	( 1, 11, 'Фичин баг' ),
	( 2, 11, 'Фичинa баг' ),
	( 3, 11, 'Фичин багa' ),
	( 4, 11, 'Фичинa багa' ),
    ( 10, 11, 'english text' ),
    ( 11, 11, 'englisha text' ),
    ( 12, 11, 'englisha texta' ),
    ( 13, 11, 'english texta' )
</db_insert>
<metaindex name='META:plain'>
<index>testla</index>
<index>testl</index>
<index>testlae</index>
<index>testwe</index>
<index>testw</index>
<index>testce</index>
<index>testc</index>
<index>testpr</index>
<index>testple</index>
</metaindex>

<sphqueries>

<sphinxql>SELECT id,gid,weight(),packedfactors() as my_weight FROM META:plain WHERE MATCH('Фичин баг') option ranker=expr('sum(exact_hit)');show meta</sphinxql>
<sphinxql>SELECT id,gid,weight() as my_weight FROM META:plain WHERE MATCH('Фичин баг') option ranker=sph04;show meta</sphinxql>
<sphinxql>SELECT id,gid,weight(),packedfactors() as my_weight FROM META:plain WHERE MATCH('^Фичин баг$') option ranker=expr('sum(exact_hit)');show meta</sphinxql>
<sphinxql>SELECT id,gid,weight() as my_weight FROM META:plain WHERE MATCH('^Фичин баг$') option ranker=sph04;show meta</sphinxql>
<sphinxql>SELECT id,gid,weight(),packedfactors() as my_weight FROM META:plain WHERE MATCH('"Фичин баг"') option ranker=expr('sum(exact_hit)');show meta</sphinxql>
<sphinxql>SELECT id,gid,weight() as my_weight FROM META:plain WHERE MATCH('"Фичин баг"') option ranker=sph04;show meta</sphinxql>
<sphinxql>SELECT id,gid,weight(),packedfactors() as my_weight FROM META:plain WHERE MATCH('english text') option ranker=expr('sum(exact_hit)');show meta</sphinxql>
<sphinxql>SELECT id,gid,weight() as my_weight FROM META:plain WHERE MATCH('english text') option ranker=sph04;show meta</sphinxql>
<sphinxql>SELECT id,gid,weight(),packedfactors() as my_weight FROM META:plain WHERE MATCH('"english text"') option ranker=expr('sum(exact_hit)');show meta</sphinxql>
<sphinxql>SELECT id,gid,weight() as my_weight FROM META:plain WHERE MATCH('"english text"') option ranker=sph04;show meta</sphinxql>
<sphinxql>SELECT id,gid,weight() as my_weight FROM META:plain WHERE MATCH('"Фичин баг"') option ranker=sph04;show meta</sphinxql>
<sphinxql>SELECT GROUPBY() FROM testw</sphinxql>

<!--regression lemmas at call keywords output -->
<sphinxql>INSERT INTO rt_ckw VALUES ( 1, 'фичин баг, но не фичина бага', 11 )</sphinxql>
<sphinxql>CALL KEYWORDS ( 'фичин баг', 'plain_ckw', 1 )</sphinxql>
<sphinxql>CALL KEYWORDS ( 'фичин баг', 'rt_ckw', 1 )</sphinxql>
<sphinxql>CALL KEYWORDS ( 'фичин баг', 'tmpl_ckw', 1 )</sphinxql>
<sphinxql>CALL KEYWORDS ( 'фичина бага', 'plain_ckw', 1 )</sphinxql>
<sphinxql>CALL KEYWORDS ( 'фичина бага', 'rt_ckw', 1 )</sphinxql>
<sphinxql>CALL KEYWORDS ( 'фичина бага', 'tmpl_ckw', 1 )</sphinxql>
<sphinxql>CALL KEYWORDS ( 'сталин жил', 'plain_ckw', 1 )</sphinxql>
<sphinxql>CALL KEYWORDS ( 'сталин жил', 'rt_ckw', 1 )</sphinxql>
<sphinxql>CALL KEYWORDS ( 'сталин жил', 'tmpl_ckw', 1 )</sphinxql>
<sphinxql>CALL KEYWORDS ( 'DovE', 'plain_ckw', 1 )</sphinxql>
<sphinxql>CALL KEYWORDS ( 'DovE', 'rt_ckw', 1 )</sphinxql>
<sphinxql>CALL KEYWORDS ( 'DovE', 'tmpl_ckw', 1 )</sphinxql>
<sphinxql>CALL KEYWORDS ( 'records recorded recording men man mans mens', 'plain_ckw', 1 )</sphinxql>
<sphinxql>CALL KEYWORDS ( 'records recorded recording men man mans mens', 'rt_ckw', 1 )</sphinxql>
<sphinxql>CALL KEYWORDS ( 'records recorded recording men man mans mens', 'tmpl_ckw', 1 )</sphinxql>

<!-- field-start, field-end escaping test -->
<sphinxql>SET profiling=1</sphinxql>
<sphinxql>SELECT id FROM testw WHERE MATCH('\\^one\\$') limit 1</sphinxql>
<sphinxql>SHOW PLAN</sphinxql>

</sphqueries>

</test>