Handling MySQL Full Text Special Characters

前端 未结 2 1561
礼貌的吻别
礼貌的吻别 2021-01-18 07:58

When using MySQL full text search in boolean mode there are certain characters like + and - that are used as operators. If I do a search for something like \"C++\" it interp

2条回答
  •  一向
    一向 (楼主)
    2021-01-18 08:33

    There's no way to do this in nicely using MySQL's full text search. What you're doing (substituting special characters with a pre-defined string) is the only way to do it.

    You may wish to consider using Sphinx Search instead. It apparently supports escaping special characters, and by all reports is significantly faster than the default full text search.

提交回复
热议问题