<?xml version="1.0" encoding="utf-8"?>
<test>

<name>stemming</name>

<config>
indexer
{
	mem_limit		= 16M
}

searchd
{
	<searchd_settings/>
}

source srctest
{
	type			= mysql
	<sql_settings/>
	sql_query		= SELECT * FROM test_table
}

index test
{
	source			= srctest
	path			= <data_path/>/test
    charset_type 	= utf-8
	charset_table	= -, 0..9, A..Z->a..z, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F
	morphology		= stem_ru, stem_en
}

index morph0
{
	source			= srctest
	path			= <data_path/>/morph0

	dict			= keywords
	min_prefix_len	= 1
	enable_star	= 1
}

index morph1
{
	source			= srctest
	path			= <data_path/>/morph1

	dict			= keywords
	min_prefix_len	= 1
	enable_star	= 1
	morphology = stem_en
}
</config>

<queries>
<!-- long query after proximity length was not properly 0-terminated, and caused overlong token to be passed to stemmer, and crash -->
<query mode="extended2">"one two"~3                                                                                                                                                                                                                                                                                                                                                                            three</query>

<!--here is going regression dict=keywords got broken by morphology-->
<query mode="extended2" index="morph1">=running</query>
<query mode="extended2" index="morph1">=run</query>
<query mode="extended2" index="morph1">running*</query>
<query mode="extended2" index="morph1">runnin*</query>
<query mode="extended2" index="morph1">run*</query>
<query mode="extended2" index="morph1">ru*</query>
<query mode="extended2" index="morph1">=runnin*</query>
<query mode="extended2" index="morph1">runnings*</query>
<query mode="extended2" index="morph1">runnin</query>
<query mode="extended2" index="morph1">running</query>
<query mode="extended2" index="morph1">run</query>

<query mode="extended2" index="morph0">=running</query>
<query mode="extended2" index="morph0">=run</query>
<query mode="extended2" index="morph0">running*</query>
<query mode="extended2" index="morph0">runnin*</query>
<query mode="extended2" index="morph0">run*</query>
<query mode="extended2" index="morph0">ru*</query>
<query mode="extended2" index="morph0">=runnin*</query>
<query mode="extended2" index="morph0">runnings*</query>
<query mode="extended2" index="morph0">runnin</query>
<query mode="extended2" index="morph0">running</query>
<query mode="extended2" index="morph0">run</query>

</queries>

<sphqueries>
<!-- here is going regression 2byte vs 2byte + sbc -->
<sphinxql>CALL KEYWORDS ('то-тический', 'test')</sphinxql>
<sphinxql>CALL KEYWORDS ('тоЫтический', 'test')</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_drop>
DROP TABLE IF EXISTS `test_table`
</db_drop>

<db_insert>
INSERT INTO `test_table` VALUES
( 1,  'and nothing else matters' ),
( 2, 'running into trouble' )
</db_insert>

</test>