简体   繁体   中英

Mutually Exclusive MySQL Full-Text Search

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'.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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