mysql->匹配全文搜索 [英] Mysql -> MATCH AGAINST FULL TEXT SEARCH
本文介绍了mysql->匹配全文搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含数百万条记录的表,例如:
I have a table with millions of records, for example:
id Name Age
1 john 23
2 peter 27
3 moses 23
........
使用MySQL MATCH AGAINST查询类似.我想选择第三行名称 moses &年龄 23 .
Like this using MySQL MATCH AGAINST query. I want to pick the third row which has name moses & age 23.
我可以使用普通查询,例如:从表中选择,其中name ='moses'&年龄= '23'
I can use an ordinary query like:
select from table where name='moses' && age ='23'
但这需要很多时间.因此,我的朋友告诉我使用匹配查询.谁能告诉我我们是否可以在匹配查询"及其优势中做到这一点?
But this takes a lot of time. So, my friend told me to use a Match Against Query. Can anyone tell me whether we can do this in a Match Against Query and its advantages?
我们如何使用 MATCH()... AGAINST
语法编写以上查询?
How can we write the above query using a MATCH() ... AGAINST
syntax?
推荐答案
SELECT *
FROM table AS t
WHERE MATCH(t.Name) AGAINST('moses')
AND t.Age=23
这篇关于mysql->匹配全文搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文