<?xml version="1.0" encoding="utf-8"?>
<Test>
  <Name>attributes over network</Name>
  <Config>
    <Static>indexer
{
	mem_limit			= 16M
}

searchd
{
</Static><Searchd_Settings/><Static>
}

source src1
{
	type			= mysql
</Static>
<Sql_Settings/>
<Static>
	sql_query = SELECT id, adtext, heading, postcode, lng, lat, section, make_id, transmission_id FROM test_table

	sql_attr_float	= lng
	sql_attr_float	= lat
	sql_attr_uint	= section
	sql_attr_uint	= make_id
	sql_attr_uint	= transmission_id
}

source src2
{
	type			= mysql
</Static>
<Sql_Settings/>
<Static>
	sql_query = SELECT id, adtext, heading, postcode, lng, lat, section, make_id, transmission_id FROM test_table

	sql_attr_float	= lng
	sql_attr_float	= lat
	sql_attr_uint	= section
	sql_attr_uint	= make_id
	sql_attr_uint	= transmission_id
}


source src3
{
	type			= mysql
</Static>
<Sql_Settings/>
<Static>
	sql_query = SELECT id, adtext, heading, postcode, lng, lat, section, make_id, transmission_id FROM test_table

	sql_attr_float	= lng
	sql_attr_float	= lat
	sql_attr_uint	= section
	sql_attr_uint	= make_id
	sql_attr_uint	= transmission_id
}

source src4
{
	type			= mysql
</Static>
<Sql_Settings/>
<Static>
	sql_query = SELECT id, adtext, heading, postcode, lng, lat, section, make_id, transmission_id FROM test_table

	sql_attr_float	= lng
	sql_attr_float	= lat
	sql_attr_uint	= section
	sql_attr_uint	= make_id
	sql_attr_uint	= transmission_id
}

index block1
{
	source			= src1
	path			= </Static><Data_Path/><Static>/block1
	docinfo			= extern
	charset_type	= utf-8
	min_word_len	= 1
	charset_type	= sbcs
}

index block2
{
	source			= src2
	path			= </Static><Data_Path/><Static>/block2
	docinfo			= extern
	charset_type	= utf-8
	min_word_len	= 1
	charset_type	= sbcs
}

index block3
{
	source			= src3
	path			= </Static><Data_Path/><Static>/block3
	docinfo			= extern
	charset_type	= utf-8
	min_word_len	= 1
	charset_type	= sbcs
}

index block4
{
	source			= src4
	path			= </Static><Data_Path/><Static>/block4
	docinfo			= extern
	charset_type	= utf-8
	min_word_len	= 1
	charset_type	= sbcs
}

index dist
{
	type					= distributed
	local					= block1
	agent					= </Static><Agent_Address/><Static>:block2
	agent_connect_timeout	= 1000
	agent_query_timeout		= 3000
}
</Static>
  </Config>

  <Num_Agents>2</Num_Agents>

  <Query_Attributes>
	<Attr_1>lng</Attr_1>
	<Attr_2>lat</Attr_2>
	<Attr_3>@geodist</Attr_3>
  </Query_Attributes>

  <Query_Settings>
	$client->SetGeoAnchor ('lng','lat',-0.0798578,0.937717 );
	$client->SetSortMode ( SPH_SORT_EXTENDED, '@geodist DESC' );
	$results = $client->Query ( $query, 'dist' );
  </Query_Settings>

  <Query>
    <Query_0></Query_0>
  </Query>
  <DB_Create>
CREATE TABLE `test_table` (
  `id` int(11) NOT NULL auto_increment,
  `section` int(11) NOT NULL,
  `system_id` tinyint(4) NOT NULL,
  `adtext` varchar(255) NOT NULL,
  `heading` varchar(500) NOT NULL,
  `price` int(11) NOT NULL default '0',
  `postcode` varchar(10) NOT NULL,
  `gre` int(11) NOT NULL,
  `grn` int(11) NOT NULL,
  `str_at1` varchar(255) NOT NULL,
  `str_at2` varchar(255) NOT NULL,
  `str_at3` varchar(255) NOT NULL,
  `str_at4` varchar(255) NOT NULL,
  `str_at5` varchar(255) NOT NULL,
  `int_at1` int(11) default NULL,
  `int_at2` int(11) default NULL,
  `int_at3` int(11) default NULL,
  `int_at4` int(11) default NULL,
  `int_at5` int(11) default NULL,
  `float_at1` float default NULL,
  `float_at2` float default NULL,
  `float_at3` float default NULL,
  `lng` float NOT NULL default '0',
  `lat` float NOT NULL default '0',
  `make_id` int(11) NOT NULL,
  `transmission_id` tinyint(4) NOT NULL,
  PRIMARY KEY  (`id`)
)
  </DB_Create>

  <DB_Drop>
DROP TABLE IF EXISTS `test_table`
  </DB_Drop>

  <DB_Insert>
INSERT INTO `test_table` (`id`, `section`, `system_id`, `adtext`, `heading`, `price`, `postcode`, `gre`, `grn`, `str_at1`, `str_at2`, `str_at3`, `str_at4`, `str_at5`, `int_at1`, `int_at2`, `int_at3`, `int_at4`, `int_at5`, `float_at1`, `float_at2`, `float_at3`, `lng`, `lat`, `make_id`, `transmission_id`) VALUES 
(1, 1, 2, 'FORD', 'Ford KA', 2790, 'EN3 5BT', 535000, 197400,  'Ford', 'KA', 'Grey', 'Diesel', '', 18662, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -0.0798578, 0.937717, 8, 1),
(2, 1, 0, 'until', 'Vauxhall Corsa', 5800, 'BN42 4RN', 524000, 106100, 'Vauxhall', 'Corsa', 'Red', 'Petrol', '', 19296, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -0.0799989, 0.891975, 5, 0),
(211250, 0, 1, 'Quattro Roadster', 'Audi TT', 13995, 'E9 7DG', 535600, 184200, '', '', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -0.0721455, 0.926761, 29, 1);
  </DB_Insert>
</Test>
