Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持mysql全文检索吗 #265

Closed
MaDaMaDaMaDa opened this issue Jul 7, 2021 · 5 comments
Closed

支持mysql全文检索吗 #265

MaDaMaDaMaDa opened this issue Jul 7, 2021 · 5 comments

Comments

@MaDaMaDaMaDa
Copy link

环境信息

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

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

错误信息

@MaDaMaDaMaDa
Copy link
Author

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

@TommyLemon
Copy link
Collaborator

TommyLemon commented Jul 7, 2021

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

@MaDaMaDaMaDa
Copy link
Author

感谢

@TommyLemon
Copy link
Collaborator

TommyLemon commented Sep 18, 2021

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

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

@TommyLemon
Copy link
Collaborator

TommyLemon commented Apr 3, 2022

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants