How to use raw sort condition
cevin opened this issue · 2 comments
cevin commented
model::search('keyword')->orderBy('weight()', 'desc')
"sphinxql: syntax error, unexpected $undefined near '`weight()` desc, `id` desc limit 20 OPTION max_matches=1000;'"
RomanStruk commented
model::search('keyword', fn($builder) => $builder->orderByRaw('weight() DESC'))->get();
RomanStruk commented
Scout builder does not support sorting by expression