<?xml version="1.0" encoding="utf-8"?>
<Test>
  <Name>subtree cache reset on size limit</Name>

<Config>
indexer
{
	mem_limit			= 16M
}

searchd
{
<dynamic>
<variant>	subtree_docs_cache	= 0</variant>
<variant>	subtree_docs_cache 	= 40</variant>
<variant>	subtree_docs_cache	= 100</variant>

</dynamic>
    subtree_hits_cache			= 1000
<Searchd_Settings/>
}

source srctest
{
	type			= mysql
<Sql_Settings/>

	sql_query = SELECT * FROM test_table
}

index test_idx
{
	source			= srctest
	path			= <Data_Path/>/test
}
</Config>
<DB_Create>
CREATE TABLE `test_table` (
  `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, 'a b c d' ),
( 2, 'a b e f' )
</DB_Insert>

<Custom_test><![CDATA[
$client->SetMatchMode ( SPH_MATCH_EXTENDED2 );
$client->AddQuery ("(a b)|(c d)");
$client->AddQuery ("(a b)|(e f)");
$results = $client->RunQueries ();
for ( $i=0; $i<2; $i++ )
	if ( is_array($results) && is_array($results[$i]) )
		unset ( $results[$i]["time"] );
]]></Custom_test>

</Test>
