H
H
hrustbb22021-11-01 14:49:11
Sphinx
hrustbb2, 2021-11-01 14:49:11

How does manticore search deal with typos in queries?

I tried this: I
use the library
Created an index

$config = ['host'=>'manticore','port'=>9308]
$client = new Client($config);
$suggest = $client->index('suggest');
$suggest->create([
            'explanation' => [
                'type' => 'text',
            ],
        ],
        [
            'min_infix_len' => 1,
            'dict' => 'keywords',
        ]);

Added documents
$suggest->addDocument([
                'explanation' => 'Автобус',
            ]);


Then the query itself
$query = [
        'index' => 'suggest',
        'body' => [
            'query' => 'овтобус',
            'options' => [
                'limit' => 1,
            ],
        ],
    ];
    
$r = $client->suggest($query);


But the result is empty. Who solved such a problem? What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
ManticoreSearch, 2021-11-02
@hrustbb2

This is how it works:

mysql> drop table if exists suggest; create table suggest(explanation text) min_infix_len='1' dict='keywords'; insert into suggest values(0,'Автобус'); call suggest('овтобус', 'suggest', 1 as limit);
Query OK, 0 rows affected (0.05 sec)

Query OK, 0 rows affected, 1 warning (0.01 sec)

Query OK, 1 row affected (0.02 sec)

+----------------+----------+------+
| suggest        | distance | docs |
+----------------+----------+------+
| автобус        | 1        | 1    |
+----------------+----------+------+
1 row in set (0.00 sec)

Try using mysql instead of php client. You have already filed an issue about the bug in the php client https://github.com/manticoresoftware/manticoresear... We
'll fix it when the time comes. Pull requests are welcome!

P
Puma Thailand, 2021-11-01
@opium

So the sphinx can't work with typos

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question