Replies: 2 comments
-
You can experiment with ranking and mysql> drop table if exists test; create table test(title text) charset_table = 'non_cont, chinese, U+1F601, 0..9, A..Z->a..z' morphology = 'jieba_chinese' min_infix_len = '2' expand_keywords = '1' index_field_lengths='1'; insert into test (title) values ('测试'),('测试账号'); select *, weight() from test where match('测试') option ranker=sph04;
+---------------------+--------------+-----------+----------+
| id | title | title_len | weight() |
+---------------------+--------------+-----------+----------+
| 1660400824146198551 | 测试 | 1 | 7356 |
| 1660400824146198552 | 测试账号 | 2 | 6356 |
+---------------------+--------------+-----------+----------+ This can be also helpful to understand how your keywords are tokenized: mysql> call keywords('测试', 'test');
+------+-----------+------------+
| qpos | tokenized | normalized |
+------+-----------+------------+
| 1 | 测试 | 测试 |
+------+-----------+------------+
mysql> call keywords('测试账号', 'test');
+------+-----------+------------+
| qpos | tokenized | normalized |
+------+-----------+------------+
| 1 | 测试 | 测试 |
| 2 | 账号 | 账号 |
+------+-----------+------------+ |
Beta Was this translation helpful? Give feedback.
-
select *, weight() from test where match('测试') option ranker=sph04; It seems that adding |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Confirmation Checklist:
Your question:
document:
Question:
weight()
result differ from the document ?Beta Was this translation helpful? Give feedback.
All reactions