douque8855 2015-04-25 07:19
浏览 7

全文搜索MySQL

I Know how to use 'full text search MySQL'. What i want to know is how to search text for words . For exmaple :- We have three records in mysql as following

1.) This is a place for programmers .
2.) People visit places for travelling purposes.
3.) programmers visit this place site for coding purposes.

Now When A user searches for 'place for programmers'

Following should be the output

it should output rows that contain all words from the sentence in any order

1.)This is a place for programmers.
2.)programmers visit this place site for coding purposes.

Thank You For Helping .

  • 写回答

2条回答 默认 最新

  • douyou2368 2015-04-25 07:42
    关注

    MySQL has MATCH..AGAINST for full text searches. Try the following,

    SELECT * FROM <table> WHERE MATCH(<column>) AGAINST('+place +for +programmers' IN BOOLEAN MODE)
    

    The +'s basically mean AND (you could use - for OR)

    https://dev.mysql.com/doc/refman/5.6/en/fulltext-boolean.html

    评论

报告相同问题?

悬赏问题

  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch