manticoresoftware / manticoresearch

Easy to use open source fast database for search | Good alternative to Elasticsearch now | Drop-in replacement for E in the ELK soon
https://manticoresearch.com
GNU General Public License v3.0
8.83k stars 489 forks source link

Update warning rel. with index_exact_words #2263

Open sanikolaev opened 3 months ago

sanikolaev commented 3 months ago

Bug Description:

The warning below is wrong, because if I do create table t(f text) index_exact_words='1' min_infix_len='2' expand_keywords='1' it disappears, but I don't add any morphology:

mysql> drop table if exists t; create table t(f text) index_exact_words='1' min_infix_len='2'; show warnings; show create table t;
--------------
drop table if exists t
--------------

Query OK, 0 rows affected (0.01 sec)

--------------
create table t(f text) index_exact_words='1' min_infix_len='2'
--------------

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

--------------
show warnings
--------------

+---------+------+------------------------------------------------------------+
| Level   | Code | Message                                                    |
+---------+------+------------------------------------------------------------+
| warning | 1000 | no morphology, index_exact_words=1 has no effect, ignoring |
+---------+------+------------------------------------------------------------+
1 row in set (0.00 sec)

--------------
show create table t
--------------

+-------+--------------------------------------------------------+
| Table | Create Table                                           |
+-------+--------------------------------------------------------+
| t     | CREATE TABLE t (
id bigint,
f text
) min_infix_len='2' |
+-------+--------------------------------------------------------+
1 row in set (0.00 sec)

The task is to update the warning.

Manticore Search Version:

Manticore 6.3.1 00e77610d@24052911 dev (columnar 2.3.1 4383a90@24052309) (secondary 2.3.1 4383a90@24052309) (knn 2.3.1 4383a90@24052309)

Operating System Version:

Ubuntu Jammy (dev2)

Have you tried the latest development version?

Yes

Internal Checklist:

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

- [ ] Implementation completed - [ ] Tests developed - [x] Documentation updated - [x] Documentation reviewed - [ ] Changelog updated
tomatolog commented 3 months ago

not quite sure why warning is wrong? And what case should have new warning or warning removal.

there is no point index exact source words if no morphology \ stemmer \ lemmatizer or wordforms used. The only doubt is to ignore expand_keywords option and still generate warning in this case.

sanikolaev commented 3 months ago

The warning is no morphology, index_exact_words=1 has no effect, ignoring, but it disappears when I add expand_keywords='1', i.e. it's still "no morphology", but there's no warning which looks wrong. There should be not just "no morphology", but "no morphology or expand_keywords" or smth which is common between them which controls this behaviour.