Home > OS >  How to Add OR Condition in Laravel Sphinx query?
How to Add OR Condition in Laravel Sphinx query?

Time:07-13

I am using the fobia/laravel-sphinx package and want to add a condition like city != 0 or state != 0 but the or condition is not working and gives tjis error:

"Syntax error or access violation: 1064 sphinxql: syntax error, unexpected OR, expecting $end near 'or "

$query->where('state_id', '!=', 0)->orWhere('city_id', '!=', 0);

It uses \Fobia\Database\SphinxConnection\Eloquent\Model

CodePudding user response:

you cant use OR condition in Sphinx
you can handle it with whereNotIn and whereIn

CodePudding user response:

These are the top rated real world PHP examples of yii\sphinx\Query::orWhere extracted from open source projects. You can rate examples to help us improve the quality of examples. Please Visit and see example

  • Related