MySQL MATCH AGAINST when searching e-mail addresses

前端 未结 2 1571
慢半拍i
慢半拍i 2021-01-06 20:40

I am writing a newsletter script and I need to implement searching in the addresses. I indexed the table with FULLTEXT but when I do a query such as:

SELECT          


        
2条回答
  •  难免孤独
    2021-01-06 21:11

    To match an exact phrase you have to enclose the phrase in double quotes. So change your query to:

    SELECT * FROM addresses WHERE MATCH(email) AGAINST('"name@example.com"' IN BOOLEAN MODE)

    Source

提交回复
热议问题