ignoring mysql fulltext stopwords in query

前端 未结 6 1030
星月不相逢
星月不相逢 2020-12-03 21:38

I\'m building a search for a site, which utilizes a fulltext search. The search itself works great, that\'s not my problem. I string together user provided keywords (MATCH..

6条回答
  •  广开言路
    2020-12-03 22:21

    For the INNODB case, it is possible to disable stop_words when you create the index.

    SET @@SESSION.innodb_ft_enable_stopword = 'OFF';
    
    create table foo
    ....
    fulltext (search_col)
    

    This will cause the full text index to be created with the stopwords disabled. You can verify by using the following queries.

    SET GLOBAL innodb_ft_aux_table = 'schema/foo';
    select * from information_schema.innodb_ft_config;
    

    Your results will look like this:

    Notice that use_stopword is set to 0.

    Search for use_stopwords on this mysql documentation page. and Checkout innodb_ft_enable_stopword here

提交回复
热议问题