Skip to content

Sorting weight problem in the jieba_chinese #3108

@xiaoge200

Description

@xiaoge200

Confirmation Checklist:

  • You have searched for an answer in the manual.
  • You have considered using the forum for general discussions, which can be more suitable for non-urgent or broad queries.
  • You are aware of our community support channels on Slack, Telegram EN, and Telegram RU, where you can interact with other users and our developers.
  • You know about Manticore Team's professional services. Engaging with our experts through a support subscription can significantly accelerate resolution times and provide tailored solutions to your specific needs.

Your question:

MySQL [(none)]> 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';
Query OK, 0 rows affected (0.721 sec)

MySQL [(none)]> insert into test (title) values ('测试'),('测试账号');
Query OK, 2 rows affected (0.014 sec)

MySQL [(none)]> select *, weight() from test where match('测试');
+---------------------+--------------+----------+
| id                  | title        | weight() |
+---------------------+--------------+----------+
| 1228051058970853385 | 测试         |     1356 |
| 1228051058970853386 | 测试账号     |     1356 |
+---------------------+--------------+----------+
2 rows in set (0.000 sec)

document:

Image

Question:

  1. Why does the weight() result differ from the document ?
  2. How can I achieve the same effect in Chinese ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions