"Fossies" - the Fresh Open Source Software Archive

Member "sphinx-2.2.11-release/test/test_226/test.xml" (19 Jul 2016, 9491 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. See also the last Fossies "Diffs" side-by-side code changes report for "test.xml": 2.2.10-release_vs_2.2.11-release.

    1 <?xml version="1.0" encoding="utf-8"?>
    2 <test>
    3 <name>multi-queries and facet keyword</name>
    4 <config>
    5 searchd
    6 {
    7     <searchd_settings/>
    8     workers                 = threads
    9 }
   10 
   11 index facetdemo
   12 {
   13     type              = rt
   14     path              = <data_path/>/facetdemo
   15     rt_field          = title
   16     rt_field          = property
   17     rt_attr_string    = title
   18     rt_attr_string    = brand_name
   19     rt_attr_string    = property
   20     rt_attr_multi     = categories
   21     rt_attr_uint      = price
   22     rt_attr_uint      = brand_id
   23     rt_attr_json      = j
   24 }
   25 
   26 index facetdemo2
   27 {
   28     source            = src
   29     path              = <data_path/>/facets
   30 }
   31 
   32 source src
   33 {
   34     type              = mysql
   35     <sql_settings/>
   36     sql_query         = SELECT * FROM test_table
   37     sql_attr_uint     = price
   38     sql_attr_uint     = brand_id
   39     sql_field_string  = title
   40     sql_attr_string   = brand_name
   41     sql_field_string  = property
   42     sql_attr_multi    = uint categories from field
   43     sql_attr_json     = j
   44 }
   45 
   46 index facetdemo3
   47 {
   48     type              = distributed
   49     local             = facetdemo
   50 }
   51 
   52 index facetdemo4
   53 {
   54     type              = distributed
   55     agent             = <my_address/>:facetdemo
   56 }
   57 
   58 </config>
   59 
   60 <db_create>
   61 CREATE TABLE `test_table` (
   62   `id` int(11),
   63   `price` int(11),
   64   `brand_id` int(11),
   65   `title` varchar(255),
   66   `brand_name` varchar(255),
   67   `property` varchar(255),
   68   `categories` varchar(255),
   69   `j` varchar(255)
   70 );
   71 </db_create>
   72 
   73 <db_drop>DROP TABLE IF EXISTS `test_table`;</db_drop>
   74 
   75 <db_insert>
   76 insert into test_table (id,price,brand_id,title,brand_name,property,categories,j) values
   77 (1,529,9,'Product Five Two','Brand Nine','Four','(13,14)','{x:[13,14],a:["a13","a14"]}'),
   78 (2,173,10,'Product Five Seven','Brand Ten','Four','(10)','{x:[10],a:["a10"]}'),
   79 (3,121,1,'Product Seven Nine','Brand One','Five','(13,14,15)','{x:[13,14,15],a:["a13","a14","a15"]}'),
   80 (4,474,7,'Product Ten Three','Brand Seven','Nine','(10,11,12)','{x:[10,11,12],a:["a10","a11","a12"]}'),
   81 (5,20,7,'Product Ten Four','Brand Seven','Seven','(13)','{x:[13],a:["a13"]}'),
   82 (6,100,3,'Product One Three','Brand Three','Seven','(10)','{x:[10],a:["a10"]}'),
   83 (7,724,9,'Product Four Eight','Brand Nine','Five','(11,12,13)','{x:[11,12,13],a:["a11","a12","a13"]}'),
   84 (8,13,3,'Product Seven One','Brand Three','Eight','(12,13,14)','{x:[12,13,14],a:["a12","a13","a14"]}'),
   85 (9,54,2,'Product Ten Seven','Brand Two','Eight','(11)','{x:[11],a:["a11"]}'),
   86 (10,986,6,'Product Six Ten','Brand Six','Eight','(12,13,14)','{x:[12,13,14],a:["a12","a13","a14"]}'),
   87 (11,100,10,'Product One Ten','Brand Ten','Four','(11)','{x:[11],a:["a11"]}'),
   88 (12,69,10,'Product Five Seven','Brand Ten','Two','(12,13,14)','{x:[12,13,14],a:["a12","a13","a14"]}'),
   89 (13,365,4,'Product Two Nine','Brand Four','Ten','(10,11,12)','{x:[10,11,12],a:["a10","a11","a12"]}'),
   90 (14,455,1,'Product Two Eight','Brand One','Nine','(13,14,15)','{x:[13,14,15],a:["a13","a14","a15"]}'),
   91 (15,718,4,'Product Nine Two','Brand Four','Eight','(10)','{x:[10],a:["a10"]}'),
   92 (16,758,9,'Product Eight Ten','Brand Nine','Seven','(13)','{x:[13],a:["a13"]}'),
   93 (17,493,4,'Product Nine Six','Brand Four','Five','(11,12)','{x:[11,12],a:["a11","a12"]}'),
   94 (18,413,3,'Product Eight Five','Brand Three','Four','(11,12,13)','{x:[11,12,13],a:["a11","a12","a13"]}'),
   95 (19,78,4,'Product Six Five','Brand Four','Two','(12)','{x:[12],a:["a12"]}'),
   96 (20,169,4,'Product Seven Six','Brand Four','Eight','(10,11)','{x:[10,11],a:["a10","a11"]}')
   97 </db_insert>
   98 
   99 <sphqueries>
  100 
  101 <sphinxql>
  102 insert into facetdemo (id,price,brand_id,title,brand_name,property,categories,j) values
  103 (1,529,9,'Product Five Two','Brand Nine','Four',(13,14),'{x:[13,14],a:["a13","a14"]}'),
  104 (2,173,10,'Product Five Seven','Brand Ten','Four',(10),'{x:[10],a:["a10"]}'),
  105 (3,121,1,'Product Seven Nine','Brand One','Five',(13,14,15),'{x:[13,14,15],a:["a13","a14","a15"]}'),
  106 (4,474,7,'Product Ten Three','Brand Seven','Nine',(10,11,12),'{x:[10,11,12],a:["a10","a11","a12"]}'),
  107 (5,20,7,'Product Ten Four','Brand Seven','Seven',(13),'{x:[13],a:["a13"]}'),
  108 (6,100,3,'Product One Three','Brand Three','Seven',(10),'{x:[10],a:["a10"]}'),
  109 (7,724,9,'Product Four Eight','Brand Nine','Five',(11,12,13),'{x:[11,12,13],a:["a11","a12","a13"]}'),
  110 (8,13,3,'Product Seven One','Brand Three','Eight',(12,13,14),'{x:[12,13,14],a:["a12","a13","a14"]}'),
  111 (9,54,2,'Product Ten Seven','Brand Two','Eight',(11),'{x:[11],a:["a11"]}'),
  112 (10,986,6,'Product Six Ten','Brand Six','Eight',(12,13,14),'{x:[12,13,14],a:["a12","a13","a14"]}'),
  113 (11,100,10,'Product One Ten','Brand Ten','Four',(11),'{x:[11],a:["a11"]}'),
  114 (12,69,10,'Product Five Seven','Brand Ten','Two',(12,13,14),'{x:[12,13,14],a:["a12","a13","a14"]}'),
  115 (13,365,4,'Product Two Nine','Brand Four','Ten',(10,11,12),'{x:[10,11,12],a:["a10","a11","a12"]}'),
  116 (14,455,1,'Product Two Eight','Brand One','Nine',(13,14,15),'{x:[13,14,15],a:["a13","a14","a15"]}'),
  117 (15,718,4,'Product Nine Two','Brand Four','Eight',(10),'{x:[10],a:["a10"]}'),
  118 (16,758,9,'Product Eight Ten','Brand Nine','Seven',(13),'{x:[13],a:["a13"]}'),
  119 (17,493,4,'Product Nine Six','Brand Four','Five',(11,12),'{x:[11,12],a:["a11","a12"]}'),
  120 (18,413,3,'Product Eight Five','Brand Three','Four',(11,12,13),'{x:[11,12,13],a:["a11","a12","a13"]}'),
  121 (19,78,4,'Product Six Five','Brand Four','Two',(12),'{x:[12],a:["a12"]}'),
  122 (20,169,4,'Product Seven Six','Brand Four','Eight',(10,11),'{x:[10,11],a:["a10","a11"]}')
  123 </sphinxql>
  124 
  125 <!-- multi-queries require at least one ';' (see helpers.inc) -->
  126 
  127 <!-- standard multi-queries: rt, plain, local, agent (the latter two aren't optimized, see query log) -->
  128 <sphinxql>select groupby() as selected,count(*) as cnt from facetdemo group by categories order by cnt desc limit 0,10; select groupby() as selected,count(*) as cnt from facetdemo group by brand_id order by cnt desc limit 0,10</sphinxql>
  129 <sphinxql>select groupby() as selected,count(*) as cnt from facetdemo2 group by categories order by cnt desc limit 0,10; select groupby() as selected,count(*) as cnt from facetdemo2 group by brand_id order by cnt desc limit 0,10</sphinxql>
  130 <sphinxql>select groupby() as selected,count(*) as cnt from facetdemo3 group by categories order by cnt desc limit 0,10; select groupby() as selected,count(*) as cnt from facetdemo3 group by brand_id order by cnt desc limit 0,10</sphinxql>
  131 <sphinxql>select groupby() as selected,count(*) as cnt from facetdemo4 group by categories order by cnt desc limit 0,10; select groupby() as selected,count(*) as cnt from facetdemo4 group by brand_id order by cnt desc limit 0,10</sphinxql>
  132 
  133 <!-- facet keyword for rt and plain indexes -->
  134 <sphinxql>select id from facetdemo limit 0,1 facet brand_id as x order by x asc;</sphinxql>
  135 <sphinxql>select id from facetdemo limit 0,1 facet interval(price,500) as x order by x asc;</sphinxql>
  136 <sphinxql>select id from facetdemo limit 0,1 facet brand_name by brand_id;</sphinxql>
  137 <sphinxql>select id from facetdemo limit 0,1 facet brand_name,property by brand_id,property;</sphinxql>
  138 <sphinxql>select id from facetdemo limit 0,1 facet brand_id+1 by brand_id+2 order by count(*) asc;</sphinxql>
  139 <sphinxql>select id from facetdemo limit 0,1 facet brand_id order by facet() asc;</sphinxql>
  140 <sphinxql>select id from facetdemo limit 0,1 facet brand_id+1-1 order by facet() desc;</sphinxql>
  141 <sphinxql>select id from facetdemo limit 0,1 facet categories facet j.x facet j.a;</sphinxql>
  142 <sphinxql>select * from facetdemo where match ('one') limit 0,15 facet brand_name, brand_id by brand_id order by brand_id asc facet property order by count(*) desc facet interval(price,200,400,600,800) order by facet() asc; show meta</sphinxql>
  143 
  144 <sphinxql>select id from facetdemo2 limit 0,1 facet brand_id as x order by x asc;</sphinxql>
  145 <sphinxql>select id from facetdemo2 limit 0,1 facet interval(price,500) as x order by x asc;</sphinxql>
  146 <sphinxql>select id from facetdemo2 limit 0,1 facet brand_name by brand_id;</sphinxql>
  147 <sphinxql>select id from facetdemo2 limit 0,1 facet brand_name,property by brand_id,property;</sphinxql>
  148 <sphinxql>select id from facetdemo2 limit 0,1 facet brand_id+1 by brand_id+2 order by count(*) asc;</sphinxql>
  149 <sphinxql>select id from facetdemo2 limit 0,1 facet brand_id order by facet() asc;</sphinxql>
  150 <sphinxql>select id from facetdemo2 limit 0,1 facet brand_id+1-1 order by facet() desc;</sphinxql>
  151 <sphinxql>select id from facetdemo2 limit 0,1 facet categories facet j.x facet j.a;</sphinxql>
  152 <sphinxql>select * from facetdemo2 where match ('one') limit 0,15 facet brand_name, brand_id by brand_id order by brand_id asc facet property order by count(*) desc facet interval(price,200,400,600,800) order by facet() asc; show meta</sphinxql>
  153 
  154 <!-- interval function for json fields -->
  155 <sphinxql>select j.x from facetdemo limit 0,1 facet interval(j.x[0],10,11,12,13);</sphinxql>
  156 
  157 <!-- multi-queries with string filters -->
  158 <sphinxql>select id, title, property from facetdemo2 where match ('product') and property='Four' order by id asc; select id, title, property from facetdemo2 where match ('product') and property='Seven' order by id asc</sphinxql>
  159 
  160 <!-- count(*) statement with different spacing -->
  161 <sphinxql>select id from facetdemo limit 0,1 facet brand_id order by count(*) asc;</sphinxql>
  162 <sphinxql>select id from facetdemo limit 0,1 facet brand_id order by count(  *) asc;</sphinxql>
  163 <sphinxql>select id from facetdemo limit 0,1 facet brand_id order by count ( *  ) asc;</sphinxql>
  164 <sphinxql>select id from facetdemo limit 0,1 facet brand_id order by count (* ) asc;</sphinxql>
  165 <sphinxql>select id from facetdemo limit 0,1 facet brand_id order by count(* ) asc;</sphinxql>
  166 
  167 </sphqueries>
  168 
  169 </test>