Skip to content

[Feature Request]: Use NLP word breaker in fulltext query. #21774

Closed

Description

@fengttt

Is there an existing issue for the same feature request?

  • I have checked the existing issues.

Is your feature request related to a problem?

At this moment we used a simple space/punctuation breaking for latin and 3-gram
for CJK in BOTH indexing time and query time.

Sometimes it is more desirable to use a NLP word breaker.

Describe the feature you'd like

Our word breaker is pluggable. We can use any word breaker in either indexing time or query time.

For Chinese, Chinese, for example, https://github.com/yanyiwu/gojieba

There are both advantages and disadvantages to use a NLP word breaker. I would suggest at this moment, we keep the simple 3-gram breaker at indexing time. For query time, esp when match in natural language mode, we should consider using NLP word breaker.

Describe implementation you've considered

No response

Documentation, Adoption, Use Case, Migration Strategy

Additional information

No response

Activity

  1. added
    priority/p0
    on Apr 29, 2025
  2. added theissue type on Apr 29, 2025
  3. added this to the MO-2506 milestone on Apr 29, 2025
  4. cpegeric commented on Apr 29, 2025

    @cpegeric
    Contributor

    I think we have to stick with one tokenizer in index time and search time. Otherwise, we cannot find the answer. e.g. 但是可以接入 3- gram will break down to "但是可", "是可以", "以接入", "接入", "入". but dictionary-based tokenizer will break down to "但是", "可以", "接入 ". If 3-gram in index table, search time with dict-based, It won't find anything, unless all search become prefix_eq() instead of ==.

  5. cpegeric commented on Apr 29, 2025

    @cpegeric
    Contributor

    there is a problem in gojieba library too. It doesn't support N-gram. e..g the search string "是可" cannot be found in index. I don't think gojieba library is suitable for our needs.

  6. cpegeric commented on Apr 29, 2025

    @cpegeric
    Contributor

    The only way to reduce the number of token is to use 2-GRAM.

  7. modified the milestones: MO-2506, MO-2507 on Jul 17, 2025
  8. cpegeric commented on Jul 21, 2025

    @cpegeric
    Contributor

    09

  9. modified the milestones: MO-2507, MO-2508 on Aug 11, 2025
  10. modified the milestones: MO-2508, MO-202602 on Feb 3, 2026
  11. cpegeric commented on Aug 27, 2026

    @cpegeric
    Contributor

    please close this issue as we already have gojieba

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/featurepriority/p0

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions