How do FULLTEXT INDEXES on multiple columns work?

前端 未结 3 1431
一生所求
一生所求 2020-12-16 12:53

When adding a FULLTEXT INDEX on 3 columns, does that add 1 single index on 3 columns, or does it add 3 separate indexes?

I ask this, because at the moment I\'m using

3条回答
  •  暖寄归人
    2020-12-16 13:00

    In MySQL, you need to create a separate index on each set of columns you plan to use (if you are using the natural language search. This may differ for the boolean search).

    From the manual:

    For natural-language full-text searches, it is a requirement that the columns named in the MATCH() function be the same columns included in some FULLTEXT index in your table. [...] If you wanted to search the title or body separately, you would need to create separate FULLTEXT indexes for each column.

提交回复
热议问题