Skip to content

支持mysql全文检索吗 #265

Closed
Closed

Description

@MaDaMaDaMaDa

环境信息

  • 系统:
  • JDK:
  • 数据库:
  • APIJSON:

问题描述
如题: 支持mysql全文检索吗?

错误信息

Activity

  1. MaDaMaDaMaDa commented on Jul 7, 2021

    @MaDaMaDaMaDa
    Author

    有的话能否给个实现例子, 文档里都没有啊

  2. TommyLemon commented on Jul 7, 2021

    @TommyLemon
    Member

    APIJSON 本身未做全文检索功能,增删改查都依赖数据库及 SQL 来实现。
    目前 MySQL 5.6+ 支持全文检索
    https://www.jianshu.com/p/c48106149b6a

    需要用到 APIJSON 的关键词 @raw
    https://github.com/Tencent/APIJSON/blob/master/Document.md#3.2

    如果对性能没有高的要求,不是非得用全文检索,直接用 LIKE 或 REGEXP 就行了,多个字段 OR 连接用 @combine
    #107

    可以这里提个建议,后续 APIJSON 适配下 MATCH(title,content) AGAINST('word' IN NATURAL LANGUAGE MODE) 这样的语法
    #37

    如果不限 MySQL,也可以看下这个是否满足你的搜索需求
    https://github.com/chenyanlann/APIJSONDemo_ClickHouse

    Elasticsearch 和 Clickhouse 基本查询对比
    https://zhuanlan.zhihu.com/p/353296392

  3. MaDaMaDaMaDa commented on Jul 7, 2021

    @MaDaMaDaMaDa
    Author

    感谢

  4. TommyLemon commented on Sep 18, 2021

    @TommyLemon
    Member

    试试这个,应该支持 MySQL 全文检索的表达式了
    https://github.com/qiujunlin/APIJSON

    对应的 PR 还没来得及验证和合并
    #305

  5. TommyLemon commented on Apr 3, 2022

    @TommyLemon
    Member

    @MaDaMaDaMaDa 4.8.3-4.9.1 可以在 @column 中用,5.0+ 可以在 @having 和 id{}:"SQL 片段" 中用 MySQL 全文检索了
    https://github.com/Tencent/APIJSON/releases/tag/5.0.0
    如图
    image

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

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