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
|
<?xml version="1.0" encoding="utf-8"?>
<test>
<name>filter</name>
<config>
indexer
{
mem_limit = 128M
}
searchd
{
<searchd_settings/>
}
source fullscan
{
type = mysql
<sql_settings/>
sql_query = select id, value as a1, value as a2, value as a3, id as b1, id as b2, id as b3, text, mva, j, gid, tag, s1 as s1raw, CRC32(s1) as s1folded from fullscan
sql_attr_uint = a1
sql_attr_uint = a2
sql_attr_uint = a3
sql_attr_uint = b1
sql_attr_uint = b2
sql_attr_uint = b3
sql_attr_multi = uint mva from field
sql_attr_json = j
sql_attr_uint = gid
sql_attr_uint = tag
sql_attr_string = s1raw
sql_attr_uint = s1folded
}
index fullscan
{
source = fullscan
path = <local>data</local>/filter
docinfo = extern
}
</config>
<sphqueries>
<!-- and block filter vs no block expression -->
<sphinxql tag="attr1 no block filter">select id from fullscan where a1=3 OPTION comment='filter attr1'</sphinxql>
<sphinxql tag="attr1 no block filter">select id, a1=3 as cnd from fullscan where cnd=1 OPTION comment ='expr attr1'</sphinxql>
<sphinxql tag="attr1 block filter">select id from fullscan where b1<10000 OPTION comment = 'filter attr1 block'</sphinxql>
<sphinxql tag="attr1 block filter">select id, b1<6000 as cnd from fullscan where cnd=1 OPTION comment = 'expr attr1 block'</sphinxql>
<!-- and2 block filter vs no block expression -->
<sphinxql tag="attr2 no block filter">select id from fullscan where a1=3 and a2=3 OPTION comment = 'filter attr2'</sphinxql>
<sphinxql tag="attr2 no block filter">select id, a1=3 and a2=3 as cnd from fullscan where cnd=1 OPTION comment = 'expr attr2'</sphinxql>
<sphinxql tag="attr2 block filter">select id from fullscan where b1<10000 and b2<20000 OPTION comment = 'filter attr2 block'</sphinxql>
<sphinxql tag="attr2 block filter">select id, b1<10000 and b2<20000 as cnd from fullscan where cnd=1 OPTION comment = 'expr attr2 block'</sphinxql>
<!-- and3 block filter vs no block expression -->
<sphinxql>select id from fullscan where a1=3 and a2=3 and a3=3 OPTION comment = 'filter attr3'</sphinxql>
<sphinxql>select id, a1=3 and a2=3 and a3=3 as cnd from fullscan where cnd=1 OPTION comment = 'expr attr3'</sphinxql>
<sphinxql>select id from fullscan where b1<10000 and b2<20000 and b3<30000 OPTION comment = 'filter attr3 block'</sphinxql>
<sphinxql>select id, b1<10000 and b2<20000 and b3<30000 as cnd from fullscan where cnd=1 OPTION comment = 'expr attr3 block'</sphinxql>
</sphqueries>
</test>
|