0

here is my query Sphinxql query

$query =SphinxQL::query()->select('*')
    ->from('table1')->match('title','hel',)->execute();

  //title is  column name

I need a records having the text hel anywhere for eg mysql Like %string%

In above its retrieving the records which are matching the hel words

I need to add setmatchmode(SPH_MATCH_ANY) where I need to add this is Sphinxql query

Mahendra Jella
  • 5,450
  • 1
  • 33
  • 38

1 Answers1

3

Frankly you are better NOT using matching modes, even thou it is technically possible via SphinxQL.

Instead just rewrite the query using quorum syntax....

->match('title',expr('"hel two there"/1'))

Edited to clarify may need to use an expression to avoid automatic escaping provided by the framework. (thanks to the comments!)

barryhunter
  • 20,886
  • 3
  • 30
  • 43
  • You might need to wrap the match in an expression, otherwise the control characters will be escaped. The Laravel library uses Foolz\SphinxQL (disclaimer: I am the creator). `->match('title', \Foolz\SphinxQL\SphinxQL::expr('"hel two there"/1'))`. Read further on match(): https://github.com/FoolCode/SphinxQL-Query-Builder#match – Woxxy May 19 '14 at 16:42