1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
<?xml version="1.0" encoding="utf-8"?>
<Test>
<Name>multi-queries</Name>
<Config>
indexer
{
mem_limit = 16M
}
searchd
{
subtree_docs_cache = 0
subtree_hits_cache = 0
<searchd_settings/>
}
source srctest
{
type = mysql
<Sql_Settings/>
sql_query = SELECT * FROM test_table
}
index test_idx
{
source = srctest
path = <Data_Path/>/test
}
source src_str
{
type = mysql
<Sql_Settings/>
sql_query = SELECT id, body, 1000+id as idd FROM test_table
sql_field_string = body
sql_attr_uint = idd
}
index str
{
source = src_str
path = <Data_Path/>/str
docinfo = extern
}
</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, 'one' ),
( 2, 'one two' ),
( 3, 'one two three' ),
( 4, 'one two three four' ),
( 5, 'one two three four five' )
</DB_Insert>
<Custom_test><![CDATA[
$client->AddQuery ('one', 'test_idx');
$client->AddQuery ('two', 'test_idx');
$client->AddQuery ('three', 'test_idx');
$client->AddQuery ('four', 'test_idx');
$client->AddQuery ('five', 'test_idx');
$results = $client->RunQueries ();
// regression crash on multi-query with string attribute group by OR sort by
// result - 5
$results[] = $client->Query ( '', 'str' );
// results - 6-8
$client->AddQuery ( '', 'str' );
$client->SetGroupBy ( 'body', SPH_GROUPBY_ATTR, 'idd desc' );
$client->AddQuery ( '', 'str' );
$client->SetSortMode ( SPH_SORT_EXTENDED, 'body ASC' );
$client->AddQuery ( '', 'str' );
$rr = $client->RunQueries();
foreach ( $rr as $r )
$results[] = $r;
for ( $i=0; $i<count($results); $i++ )
if ( is_array($results) && is_array($results[$i]) )
unset ( $results[$i]["time"] );
]]></Custom_test>
</Test>
|