<test>
<name>field position limit vs many hits</name>

<config>
indexer
{
	mem_limit = 16M
}

searchd
{
	<searchd_settings/>
}

source test
{
	type = mysql
	<sql_settings/>
	sql_query = SELECT * FROM test_table
	sql_attr_uint	= idd
	sql_file_field	= body
}

index test
{
	source			= test
	path			= <data_path/>/test
	docinfo			= extern
	
	html_strip		= 1	
	index_sp		= 1
	index_zones		= zone*
}

source start_end
{
	type = mysql
	<sql_settings/>
	sql_query = SELECT id, body, 1 as idd FROM start_end_table
	sql_attr_uint	= idd
	sql_field_string	= body
}

index start_end
{
	source			= start_end
	path			= <data_path/>/start_end
	docinfo			= extern
}
</config>

<db_create>
CREATE TABLE test_table
(
	id INT NOT NULL,
	body VARCHAR(2048) NOT NULL,
	idd INT NOT NULL
);
</db_create>
<db_create>
CREATE TABLE start_end_table
(
	id INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
	body VARCHAR(64) NOT NULL
);
</db_create>

<db_drop>drop table if exists test_table;</db_drop>
<db_drop>drop table if exists start_end_table;</db_drop>

<db_insert>insert into test_table values ( 1, 'test_148/doc1.txt', 1 );</db_insert>
<db_insert>insert into test_table values ( 2, 'test_148/doc2.txt', 2 );</db_insert>
<db_insert>insert into test_table values ( 3, 'test_148/doc3.txt', 3 );</db_insert>

<sphqueries>
	<sphinxql>select * from test where match ('ZONE:zoneA dummy')</sphinxql>
	<sphinxql>select * from test where match ('@body[1024] text')</sphinxql>
	<sphinxql>select * from test where match ('@body[1024] dummy')</sphinxql>
	<sphinxql>select * from start_end where match ('@body ABB') group by idd</sphinxql>
	<sphinxql>select * from start_end where match ('@body ^ABB') group by idd</sphinxql>
	<sphinxql>select * from start_end where match ('@body ABB$') group by idd</sphinxql>
	<sphinxql>select * from start_end where match ('@body ^ABB$') group by idd</sphinxql>
</sphqueries>

<custom_insert><![CDATA[

for ( $i=0; $i<98; ++$i )
	mysql_query ( "insert into start_end_table (body) values ('ABB')" );
mysql_query ( "insert into start_end_table (body) values ('ABB abc ABB')" );
for ( $i=0; $i<501; ++$i )
	mysql_query ( "insert into start_end_table (body) values ('ABB')" );

]]></custom_insert>

</test>
