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 218 219 220 221 222 223 224 225
|
<?xml version="1.0" encoding="utf-8"?>
<test>
<name>keywords dictionary vs expansion limit</name>
<config>
indexer
{
mem_limit = 16M
}
searchd
{
<searchd_settings/>
<dynamic>
<variant>expansion_limit = 0</variant>
<variant>expansion_limit = 3</variant>
<variant>expansion_limit = 2</variant>
</dynamic>
workers = threads
}
source test
{
type = mysql
<sql_settings/>
sql_query = select * from test_table
sql_attr_uint = gid
}
index test
{
source = test
path = <data_path/>/test
dict = keywords
min_prefix_len = 2
}
index rt
{
type = rt
path = <data_path/>/rt
docinfo = extern
rt_field = data
rt_attr_uint = idd
dict = keywords
min_prefix_len = 1
}
source plain_prefix
{
type = mysql
<sql_settings/>
sql_query_pre = SET NAMES utf8
sql_query = select 1000 as id, 1 as gid, 'Москва родимая' as text
sql_attr_uint = gid
}
index plain_prefix
{
source = plain_prefix
path = <data_path/>/plain_prefix
dict = keywords
min_prefix_len = 1
}
index rt_prefix
{
type = rt
path = <data_path/>/rt_prefix
docinfo = extern
rt_field = data
rt_attr_uint = idd
dict = keywords
min_prefix_len = 1
}
source plain_substring
{
type = mysql
<sql_settings/>
sql_query = select 1 id, 1 gid, '12345' as text
sql_attr_uint = gid
}
index plain_sub_prefix
{
source = plain_substring
path = <data_path/>/plain_sub_prefix
min_prefix_len = 2
max_substring_len = 3
dict = crc
}
index plain_sub_infix
{
source = plain_substring
path = <data_path/>/plain_sub_infix
min_infix_len = 2
max_substring_len = 3
dict = crc
}
source kw_infix
{
type = mysql
<sql_settings/>
sql_query = SELECT 1, '1' title, 100 as idd
sql_attr_uint = idd
}
index kw_infix
{
source = kw_infix
path = <data_path/>/kw_infix
docinfo = extern
min_infix_len = 3
dict = keywords
}
source kw_infix_morph
{
type = mysql
<sql_settings/>
sql_query = SELECT 1, 'running star' title, 100 as idd UNION SELECT 2, 'run off', 100 as idd
sql_attr_uint = idd
}
index kw_infix_morph
{
source = kw_infix_morph
path = <data_path/>/kw_infix_morph
docinfo = extern
min_infix_len = 1
dict = keywords
morphology = stem_en
}
source plain_prefix_limit
{
type = mysql
<sql_settings/>
sql_query_pre = SET NAMES utf8
sql_query = select 1000 as id, 1 as gid, 'hello two world' as text
sql_attr_uint = gid
}
index plain_prefix_limit
{
source = plain_prefix_limit
path = <data_path/>/plain_prefix_limit
dict = keywords
min_prefix_len = 4
}
index rt_prefix_limit
{
type = rt
path = <data_path/>/rt_prefix_limit
docinfo = extern
rt_field = data
rt_attr_uint = idd
dict = keywords
min_prefix_len = 4
}
</config>
<db_create>
create table test_table
(
id int not null,
gid int 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, 'funny place.' );</db_insert>
<db_insert>insert into test_table values ( 2, 1, 'is it function?' );</db_insert>
<db_insert>insert into test_table values ( 3, 1, 'functional lang. quite funny.' );</db_insert>
<db_insert>insert into test_table values ( 4, 1, 'functic sequence.' );</db_insert>
<db_insert>insert into test_table values ( 5, 1, 'fun place. funny place.' );</db_insert>
<db_insert>insert into test_table values ( 6, 1, 'its function.' );</db_insert>
<db_insert>insert into test_table values ( 7, 1, 'functional is not place.' );</db_insert>
<db_insert>insert into test_table values ( 8, 1, 'functic is not place.' );</db_insert>
<queries>
<query index="test" mode="extended2">fu*</query>
<query index="test" mode="extended2">func*</query>
</queries>
<sphqueries>
<sphinxql>insert into rt values ( 1, 'the test is going there', 11 )</sphinxql>
<sphinxql>insert into rt values ( 2, 'a sojmething is going here', 12 )</sphinxql>
<sphinxql>insert into rt values ( 3, 'testing is going not here', 13 )</sphinxql>
<sphinxql>select * from rt where match ( 't*' )</sphinxql>
<sphinxql>show meta</sphinxql>
<!-- regression prefix vs utf-8 codepoint -->
<sphinxql>insert into rt_prefix values ( 1001, 'Москва ква', 23 )</sphinxql>
<sphinxql>select * from plain_prefix where match ( 'Мос*' )</sphinxql>
<sphinxql>select * from rt_prefix where match ( 'Мос*' )</sphinxql>
<sphinxql>select * from plain_sub_prefix where match('1*')</sphinxql>
<sphinxql>select * from plain_sub_prefix where match('12*')</sphinxql>
<sphinxql>select * from plain_sub_prefix where match('123*')</sphinxql>
<sphinxql>select * from plain_sub_prefix where match('1234*')</sphinxql>
<sphinxql>select * from plain_sub_infix where match('*5')</sphinxql>
<sphinxql>select * from plain_sub_infix where match('*45')</sphinxql>
<sphinxql>select * from plain_sub_infix where match('*345')</sphinxql>
<sphinxql>select * from plain_sub_infix where match('*2345')</sphinxql>
<!--regression no infix collected at dict=keywords -->
<sphinxql>select * from kw_infix where match('1')</sphinxql>
<!--regression exact form vs infix -->
<sphinxql>select * from kw_infix_morph where match('r*')</sphinxql>
<!--regression min_prefix_len at plain vs rt -->
<sphinxql>insert into rt_prefix_limit values ( 1000, 'hello two world', 23 )</sphinxql>
<sphinxql>select * from plain_prefix_limit where match('hello two* world')</sphinxql>
<sphinxql>show meta</sphinxql>
<sphinxql>select * from rt_prefix_limit where match('hello two* world')</sphinxql>
<sphinxql>show meta</sphinxql>
</sphqueries>
</test>
|