doushi3454
2013-05-24 07:06 阅读 11
已采纳

全文布尔模式和mysql中的相似之处?

I have created full text search in my database

its showing wrong result for in Boolean mode search

SELECT * FROM catalgo_auto_productdetails  WHERE product_name like '%htc%'

showing correct result

SELECT * FROM catalgo_auto_productdetails  WHERE MATCH (`product_name`)
     AGAINST ('htc' IN BOOLEAN MODE)

showing empty result

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    duanjianao0592 duanjianao0592 2013-05-24 07:13

    As documented under Fine-Tuning MySQL Full-Text Search:

    The minimum and maximum lengths of words to be indexed are defined by the innodb_ft_min_token_size and innodb_ft_max_token_size for InnoDB search indexes, and ft_min_word_len and ft_max_word_len for MyISAM ones. After changing any of these options, rebuild your FULLTEXT indexes for the change to take effect. For example, to make two-character words searchable, you could put the following lines in an option file:

    [mysqld]
    innodb_ft_min_token_size=2
    ft_min_word_len=2
    

    Then restart the server and rebuild your FULLTEXT indexes. For MyISAM tables, note particularly the remarks regarding myisamchk in the instructions following this list.

    点赞 评论 复制链接分享

相关推荐