Answer the question
In order to leave comments, you need to log in
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',
]);
$suggest->addDocument([
'explanation' => 'Автобус',
]);
$query = [
'index' => 'suggest',
'body' => [
'query' => 'овтобус',
'options' => [
'limit' => 1,
],
],
];
$r = $client->suggest($query);
Answer the question
In order to leave comments, you need to log in
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)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question