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

<name>snippet vs blended</name>

<config>
indexer
{
	mem_limit		= 16M
}

searchd
{
	<searchd_settings/>
	snippets_file_prefix	= <this_test/>/
}

source src
{
	type					= mysql
	<sql_settings/>
	sql_query		= SELECT 1, 'dummy', 1 as idd
	sql_attr_uint	= idd
}

index idx
{
	source				= src
	docinfo			= extern
	path					= <data_path/>/main
	blend_chars		= .
}

index idx2
{
	source				= src
	docinfo			= extern
	path					= <data_path/>/idx2
	morphology			= stem_en
	charset_table = 0..9, a..z, A..Z->a..z
	blend_chars		= U+0028, U+0029, U+002f, U+002b
	blend_mode = trim_none, trim_head, trim_tail, trim_both, skip_pure
}

index idx_blend1
{
	type =template
	html_strip      = 1
	min_word_len    = 2
	min_infix_len   = 3
	index_sp        = 1
	dict            = keywords
	morphology = stem_en,stem_ru
	blend_chars = .
	blend_mode = trim_both
}

index idx_blend2
{
	type = template
	min_word_len = 2
	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, U+0401->U+0435, U+0451->U+0435, U+A8->U+E5, U+B8->U+E5
	ignore_chars = U+AD
	min_prefix_len = 2
	blend_chars = +, U+23
	html_strip = 1
	index_exact_words = 1
	morphology = stem_ru
}

</config>


<sphqueries>
<sphinxql>CALL SNIPPETS ('and here we go 2524460. 989561 as you said', 'idx', '=2524460.', 1 as query_mode, 4 as limit_words, 2 as around)</sphinxql>
<sphinxql>CALL SNIPPETS ('What are you need here (exactly)? are dude friendly? As I know this dude\/buddy.', 'idx2', '\(exactly\) | =dude\/buddy', 1 as query_mode, 60 as limit, 2 as around)</sphinxql>
<sphinxql>CALL SNIPPETS ('What are you need here (exactly)? are dude friendly? As I know this dude\/buddy.', 'idx2', '\(exactly\) dude\/buddy', 0 as query_mode, 2 as around)</sphinxql>
<sphinxql>CALL SNIPPETS ('What are you need here (exactly)? are dude friendly? As I know this dude\/buddy.', 'idx2', '\(exactly\) | dude\/buddy', 1 as query_mode, 2 as around)</sphinxql>

<sphinxql>CALL SNIPPETS ('What are you need here (exactly)? are dude friendly? As I know this dude\/buddy.', 'idx2', '\(exactly\) buddy', 0 as query_mode, 2 as around)</sphinxql>
<sphinxql>CALL SNIPPETS ('What are you need here (exactly)? are dude friendly? As I know this dude\/buddy.', 'idx2', '\(exactly\) | buddy', 1 as query_mode, 2 as around)</sphinxql>

<sphinxql>CALL SNIPPETS ('What are you need here+ (exactly)?', 'idx2', '\(exactly\)', 0 as query_mode, 3 as limit_passages, 2 as around)</sphinxql>
<sphinxql>CALL SNIPPETS ('What are you need here+ (exactly)?', 'idx2', '\(exactly\)', 0 as query_mode, 0 as around, 0 as limit)</sphinxql>
<sphinxql>CALL SNIPPETS ('What are you need here+ (exactly)?', 'idx2', '\(exactly\)', 1 as query_mode, 3 as limit_passages, 2 as around)</sphinxql>
<sphinxql>CALL SNIPPETS ('What are you need here+ (exactly)?', 'idx2', '\(exactly\)', 1 as query_mode, 0 as around, 0 as limit)</sphinxql>

<!-- regression hightlight of blend-char along with term -->
<sphinxql>CALL SNIPPETS ('abc +hashtag abc', 'idx2', '+hashtag', 0 as query_mode, 0 as around, 0 as limit)</sphinxql>
<sphinxql>CALL SNIPPETS ('abc +hashtag abc', 'idx2', '+hashtag', 1 as query_mode, 0 as around, 0 as limit)</sphinxql>
<sphinxql>CALL SNIPPETS ('abc +hashtag +hashtag abc', 'idx2', '+hashtag', 0 as query_mode, 0 as around, 0 as limit)</sphinxql>
<sphinxql>CALL SNIPPETS ('abc +hashtag +hashtag abc', 'idx2', '+hashtag', 1 as query_mode, 0 as around, 0 as limit)</sphinxql>
<sphinxql>CALL SNIPPETS ('abc +hashtag +hashtag', 'idx2', '+hashtag', 0 as query_mode, 0 as around, 0 as limit)</sphinxql>
<sphinxql>CALL SNIPPETS ('abc +hashtag +hashtag', 'idx2', '+hashtag', 1 as query_mode, 0 as around, 0 as limit)</sphinxql>
<sphinxql>CALL SNIPPETS ('abc +hashtag+bag abc', 'idx2', '+hashtag', 0 as query_mode, 0 as around, 0 as limit)</sphinxql>
<sphinxql>CALL SNIPPETS ('abc +hashtag+bag abc', 'idx2', '+hashtag', 1 as query_mode, 0 as around, 0 as limit)</sphinxql>
<sphinxql>CALL SNIPPETS ('abc +hashtag+bag abc', 'idx2', '+hashtag+bag', 0 as query_mode, 0 as around, 0 as limit)</sphinxql>
<sphinxql>CALL SNIPPETS ('abc +hashtag+bag abc', 'idx2', '+hashtag+bag', 1 as query_mode, 0 as around, 0 as limit)</sphinxql>
<sphinxql>CALL SNIPPETS ('abc +hashtag+bag abc', 'idx2', '+hashtag +bag', 0 as query_mode, 0 as around, 0 as limit)</sphinxql>
<sphinxql>CALL SNIPPETS ('abc +hashtag+bag abc', 'idx2', '+hashtag +bag', 1 as query_mode, 0 as around, 0 as limit)</sphinxql>
<!-- regression hightlight of blend-char along with term with passages -->
<sphinxql>CALL SNIPPETS ('hashtag+bag abc for me is not so long but who knows', 'idx2', 'hashtag+bag', 1 as query_mode, 40 as limit)</sphinxql>
<sphinxql>CALL SNIPPETS ('for me is not so long but who knows abc hashtag+bag', 'idx2', 'hashtag+bag', 1 as query_mode, 40 as limit)</sphinxql>
<sphinxql>CALL SNIPPETS ('for me is not so long abc hashtag+bag but who knows everyone is not same abc hashtag+bag as me or someone', 'idx2', 'hashtag+bag', 1 as query_mode, 40 as limit)</sphinxql>
<sphinxql>CALL SNIPPETS ('for me is not so long abc hashtag+bag but who knows everyone is not same abc hashtag+bag as me or someone', 'idx2', 'hashtag+bag', 1 as query_mode, 80 as limit)</sphinxql>
<!-- assert in the beginning of the string -->
<sphinxql>CALL SNIPPETS ('+hashtag for me is not so long but who knows', 'idx2', '+hashtag', 1 as query_mode, 40 as limit)</sphinxql>
<sphinxql>CALL SNIPPETS (('text1.txt'),'idx_blend1','mysql query',1 AS load_files)</sphinxql>
<sphinxql>CALL SNIPPETS (('text2.txt'),'idx_blend2','*алгоритм*',1 AS load_files)</sphinxql>
</sphqueries>

<db_create>
CREATE TABLE test_table
(
	id INTEGER AUTO_INCREMENT PRIMARY KEY NOT NULL,
	title VARCHAR(255) NOT NULL
);
</db_create>
<db_insert>
INSERT INTO `test_table` VALUES
( 1, 'dummy' )
</db_insert>
<db_drop>DROP TABLE IF EXISTS test_table</db_drop>

</test>
