"Fossies" - the Fresh Open Source Software Archive

Member "sphinx-2.2.11-release/test/test_032/test.xml" (19 Jul 2016, 2548 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 
    4 <name>block index vs cutoff, updates, ranges</name>
    5 
    6 <config>
    7 indexer
    8 {
    9     mem_limit       = 16M
   10 }
   11 
   12 searchd
   13 {
   14     <searchd_settings/>
   15 }
   16 
   17 source src
   18 {
   19     type            = mysql
   20     <sql_settings/>
   21 
   22     sql_query       = SELECT * FROM test_table
   23     sql_attr_uint   = tag
   24 }
   25 
   26 index idx
   27 {
   28     source          = src
   29     path            = <data_path/>/main
   30 }
   31 
   32 </config>
   33 
   34 <custom_test><![CDATA[
   35 $results = array ();
   36 
   37 // find that match
   38 // checks reject vs cutoff regression
   39 $client->SetFilter ( "tag", array(150) );
   40 $results[] = $client->Query ( "" );
   41 
   42 if ( !$results[0] )
   43 {
   44     $results = false; // maybe its temporary; lets retry
   45     return;
   46 }
   47 
   48 // update that block
   49 $results[] = $client->UpdateAttributes ( "idx", array("tag"), array(137=>array(1137)) );
   50 
   51 // find the updated match
   52 // checks that it works after the update
   53 $client->ResetFilters ();
   54 $client->SetFilter ( "tag", array(1137) );
   55 $results[] = $client->Query ( "" );
   56 
   57 // find the matches by range
   58 // checks that range queries vs fullscan block work
   59 $client->ResetFilters ();
   60 $client->SetFilterRange ( "tag", 198, 1100 );
   61 $results[] = $client->Query ( "" );
   62 
   63 $client->ResetFilters ();
   64 $client->SetFilterRange ( "tag", 127, 128 );
   65 $results[] = $client->Query ( "" );
   66 
   67 // final fixup; we don't want to compare times
   68 for ( $i=0; $i<count($results); $i++ )
   69     if ( is_array($results[$i]) )
   70         unset ( $results[$i]["time"] );
   71 ]]></custom_test>
   72 
   73 <db_create>
   74 CREATE TABLE `test_table`
   75 (
   76     `document_id` int(11) NOT NULL default '0',
   77     `tag` int(11) NOT NULL default '0',
   78     `body` varchar(255) NOT NULL default ''
   79 )
   80 </db_create>
   81 
   82 <db_insert>INSERT INTO test_table VALUES ( 1,1,'one' ), ( 2,2,'one' ), ( 3,3,'one' ), ( 4,4,'one' )</db_insert>
   83 <db_insert>INSERT INTO test_table SELECT document_id+4, tag+4, body FROM test_table</db_insert>
   84 <db_insert>INSERT INTO test_table SELECT document_id+8, tag+8, body FROM test_table</db_insert>
   85 <db_insert>INSERT INTO test_table SELECT document_id+16, tag+16, body FROM test_table</db_insert>
   86 <db_insert>INSERT INTO test_table SELECT document_id+32, tag+32, body FROM test_table</db_insert>
   87 <db_insert>INSERT INTO test_table SELECT document_id+64, tag+64, body FROM test_table</db_insert>
   88 <db_insert>INSERT INTO test_table SELECT document_id+128, tag+128, body FROM test_table</db_insert>
   89 <db_insert>DELETE FROM test_table WHERE document_id>200</db_insert>
   90 <db_insert>UPDATE test_table SET tag=200 WHERE document_id=1</db_insert>
   91 
   92 <db_drop>DROP TABLE IF EXISTS test_table</db_drop>
   93 
   94 </test>