互斥 MySQL 全文搜索
假设我有一个包含以下列的 MySQL 表:
|variables| 1. | 'a' | 2. | 'a b' | 3. | 'a b c' | 4. | ... |
如何构建不忽略列条目中的空格的 MySQL 全文搜索?
例如,我希望以下查询仅返回第 1 行:
SELECT column FROM table WHERE MATCH variables AGAINST ('a')
然而,实际上,此查询将返回第 1-3 行,因为所有三行都包含字母“a”。
Suppose I had a MySQL table with the following column:
|variables| 1. | 'a' | 2. | 'a b' | 3. | 'a b c' | 4. | ... |
How can I construct a MySQL Full-Text search that doesn't ignore white space in the column entries?
For example, I would like the following query to return only row 1:
SELECT column FROM table WHERE MATCH variables AGAINST ('a')
As it is, however, this query would return rows 1–3 because all three rows contain the letter 'a'.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的搜索规则不清楚,但这可能是 正则表达式搜索的情况 会比全文查询更好地为您服务。
Your search rules are unclear, but this may be a case where a regular expression search will serve you better than a full-text query.