"Fossies" - the Fresh Open Source Software Archive

Member "sphinx-2.2.11-release/test/test_072/test.xml" (19 Jul 2016, 1924 Bytes) of package /linux/www/sphinx-2.2.11-release.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) XML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

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