Skip to content

CALL SUGGEST parameter to disable hidden min length validation #3211

Closed
@donhardman

Description

@donhardman

Proposal:

Currently there is an issue when we use CALL SUGGEST with a phrase that is less than 3 characters; we get no results.

The suggestion is to add some parameters in case we really need to control this behaviour.

mysql> drop table if exists t;
Query OK, 0 rows affected (0.00 sec)

mysql> create table t(name text) min_infix_len='2';
Query OK, 0 rows affected (0.00 sec)

mysql> insert into t values(1, 'aa defghi xxx');
Query OK, 1 row affected (0.01 sec)

mysql> insert into t values(2, 'aa def');
Query OK, 1 row affected (0.00 sec)

mysql> select * from t where match('aa def ghi xxx') option fuzzy=1, layouts='';
Empty set (0.00 sec)
mysql> call suggest('aa', 't');
mysql> call suggest('def', 't');
+---------+----------+------+
| suggest | distance | docs |
+---------+----------+------+
| def     | 0        | 1    |
+---------+----------+------+
mysql> select * from t;
+------+---------------+
| id   | name          |
+------+---------------+
|    1 | aa defghi xxx |
|    2 | aa def        |
+------+---------------+
mysql>

Checklist:

To be completed by the assignee. Check off tasks that have been completed or are not applicable.

  • Implementation completed
  • Tests developed
  • Documentation updated
  • Documentation reviewed
  • Changelog updated
  • OpenAPI YAML updated and issue created to rebuild clients

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions