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

<name>SENTENCE, PARAGRAPH, and ZONE operators</name>

<requires>
	<variant_match/>
</requires>

<config>
indexer
{
	mem_limit		= 16M
}

searchd
{
	<searchd_settings/>
}

source test
{
	type			= mysql
	<sql_settings/>
	sql_query		= select * from test_table
	sql_attr_uint	= gid
}

index test
{
	source			= test
	path			= <data_path/>/test
	html_strip		= 1
	index_sp		= 1
	index_zones		= zone*
	<Dynamic>
		<Variant>dict = crc</Variant>
		<Variant>dict = keywords</Variant>
	</Dynamic>
	<Dynamic>
		<Variant></Variant>
		<Variant>exceptions = synonyms.txt</Variant>
	</Dynamic>
}

</config>

<db_create>
create table test_table
(
	id int not null,
	gid int not null,
	title varchar(16384) not null
);
</db_create>
<db_drop>drop table if exists test_table;</db_drop>
<db_insert>insert into test_table values ( 1, 1, 'One and one and one. And two. And three, all separate.' );</db_insert>
<db_insert>insert into test_table values ( 2, 1, 'And then we\'ll have him, one two three! Kidnap the Sandy Clawz...' );</db_insert>
<db_insert>insert into test_table values ( 3, 1, 'One two something. But not three.' );</db_insert>
<db_insert>insert into test_table values ( 4, 1, 'Two says hello to one more three.' );</db_insert>
<db_insert>insert into test_table values ( 5, 1, CONCAT(REPEAT('A ram zam zam. ', 171), 'Zam ram!') );</db_insert>
<db_insert>insert into test_table values ( 6, 1, 'A ram zam zam, a ram zam zam, guli guli guli guli ram zam zam.' );</db_insert>

<db_insert>insert into test_table values ( 100, 2, 'Quick brown fox&lt;p&gt;jumps over a lazy dog.' );</db_insert>
<db_insert>insert into test_table values ( 101, 2, 'In paragraph, yes. Not in sentence, no.' );</db_insert>

<db_insert><![CDATA[insert into test_table values ( 200, 3, '<zoneA>The time has come, <zoneB>the walrus said,</zoneB> to talk of many things.</zoneA>' );]]></db_insert>
<db_insert><![CDATA[insert into test_table values ( 201, 3, 'Of shoes, <zoneC>and ships</zoneC>, and sealing wax, of cabbages, <zoneC>, and kings.</zoneC>' );]]></db_insert>
<db_insert><![CDATA[insert into test_table values ( 211, 3, 'Of shoes, and ships, and sealing wax, of cabbages, <zoneC>, and kings.</zoneC>' );]]></db_insert>
<db_insert><![CDATA[insert into test_table values ( 202, 3, '<zoneA>Sweet dreams are made of this.</zoneA><zoneB>Who am I to disagree?</zoneB>' );]]></db_insert>

<db_insert>
<![CDATA[insert into test_table values ( 300, 4, '<zoneA>Sweet of this.</zoneA><zoneLongWord1LongWord2LongWord3LongWord4LongWord5LongWord6LongWord7LongWord8LongWord9LongWord10LongWord11LongWord12LongWord13LongWord14LongWord15LongWord16LongWord17LongWord18LongWord19LongWord20LongWord21LongWord22LongWord23LongWord24LongWord25>Who am I to disagree?</zoneLongWord1LongWord2LongWord3LongWord4LongWord5LongWord6LongWord7LongWord8LongWord9LongWord10LongWord11LongWord12LongWord13LongWord14LongWord15LongWord16LongWord17LongWord18LongWord19LongWord20LongWord21LongWord22LongWord23LongWord24LongWord25>' );]]>
</db_insert>
<!-- crash case on search - should be last too as &#4
<db_insert><![CDATA[insert into test_table values ( 301, 4, '>I like this.</zoneA> Sweet of &#1;&#2;&#3; this.' );]]></db_insert>
<db_insert><![CDATA[insert into test_table values ( 301, 4, '<zoneA>I like this.</zoneA> Sweet of &#4; this.' );]]></db_insert>
-->
<db_insert><![CDATA[insert into test_table values ( 310, 4, '<zoneA>I like this.</zoneA> Sweet of &#1;&#2;&#3; this.' );]]></db_insert>
<db_insert><![CDATA[insert into test_table values ( 311, 4, '<zoneA>I like this.</zoneA> Sweet of &#4; this.' );]]></db_insert>

<db_insert><![CDATA[insert into test_table values ( 400, 5, CONCAT('Clock',CHAR(4),'strikes twelve and moondrops burst
Out at you from their hiding place
Like acid and oil on a madman\'s face
His reason tends to fly away
Like lesser birds on the four winds
Like silver scraps in May
Now the sands become a crust
And most of you have gone away
You have gone away'));]]></db_insert>


<queries>
<query mode="extended2">one SENTENCE two</query>
<query mode="extended2">one SENTENCE two three</query>
<query mode="extended2">one SENTENCE two SENTENCE three</query>
<query mode="extended2">"one two" SENTENCE three</query>
<query mode="extended2">zam SENTENCE ram</query>

<query mode="extended2">fox PARAGRAPH dog</query>
<query mode="extended2">sentence SENTENCE paragraph</query>
<query mode="extended2">sentence PARAGRAPH paragraph</query>

<query mode="extended2">ZONE:zoneA walrus</query>
<query mode="extended2">ZONE:zoneB walrus</query>
<query mode="extended2">ZONE:zoneA walrus time</query>
<query mode="extended2">ZONE:zoneB walrus time</query>
<query mode="extended2">ZONE:zoneC cabbages and kings</query>
<query mode="extended2">ZONE:zoneC kings and ships</query>
<query mode="extended2">ZONE:(zoneA,zoneB) sweet disagree</query>
<query mode="extended2">"Who am I"</query>
<query mode="extended2">"of this"</query>
<query mode="extended2">ZONE:zoneA "like this"</query>
<query mode="extended2">strikes</query>
</queries>

</test>
