简体   繁体   English

互斥MySQL全文搜索

[英]Mutually Exclusive MySQL Full-Text Search

Suppose I had a MySQL table with the following column: 假设我有一个带有以下列的MySQL表:

   |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? 如何构造不忽略列条目中空格的MySQL全文搜索?

For example, I would like the following query to return only row 1: 例如,我希望以下查询仅返回第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'. 但是,由于所有三行都包含字母“ a”,因此该查询将返回第1-3行。

您的搜索规则尚不清楚,但是在这种情况下, 正则表达式搜索比全文查询更能为您提供服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM