php - SPHINX (search) : faking sql like on query -


i pretty new sphinx, have question it.

let's have table called tv_releases

my sphinx.conf contains (small portion) :

source tv_releases {     type            = mysql      sql_host        = localhost     sql_user        = ---------     sql_pass        = ---------     sql_db          = --------     sql_port        = 3306        sql_query_pre = set names utf8      #ingore example ( delta updates ).     sql_query_pre = replace title_counter select 3, max(id) tv_releases      sql_query = select id,rel ,tv_id,total_subs tv_releases\       #ignore example ( delta updates).      id<=( select max_doc_id title_counter counter_id=3 )      sql_attr_uint = total_subs     sql_attr_uint = tv_id } 

indexing fine , querying also.

now sphinxapi ( php ) (portion) :

$sp = new sphinxclient(); ---...  $sp->setmatchmode(sph_match_all); $sp->setarrayresult(true); $sp->setlimits ( 0, 100); $sp->setsortmode ( sph_sort_extended, "@relevance desc, ....more options" );      $results = $sp->query('searchterm', 'tv_releases'); 

now question :

let's have following releases ( called rel in table ).

rel 1 : name s01e02 format-extradata rel 2 : name s01e03 format-extradata rel 3 : name s02e05 format-extradata rel 4 : name s02e06 format-extradata rel 5 : name s03e06 format-extradata 

when searchterm "name s01"

i want matching releases ( rel) ( ordered relevance )

will start releases containing name s01e**

the problem , not this. simple 'name s01%' in sql , whole point of sphinx speed.

someone has solution on how accomplish needed (search) results in sphinx ?

cheers

min_prefix_len (http://sphinxsearch.com/docs/current.html#conf-min-prefix-len) can you.

best wishes, sergey


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -