A
A
alex_maldinsky2018-11-02 16:27:33
Sphinx
alex_maldinsky, 2018-11-02 16:27:33

How to use special in yii2 sphinx search operators?

Good afternoon.
Can you please tell me how to use search operators in yii2 + sphinx?
Sample queries:
1. "Hello world"
2. Hello !world
3. "Hello my" !friend
As I understand it, you need to use MatchExpression? Those. convert the search string to the format:

$match = (new MatchExpression())
            ->andMatch([
                'not',
                'name',
                'apple',
            ]);

How to organize it correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Puma Thailand, 2018-11-03
@opium

Make queries directly through sql

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question