简体   繁体   English

在MySQL中反对匹配无法正常工作

[英]MATCH AGAINST in MySQL don't work

I have a problem with FULLTEXT search in MySql. 我在MySql中使用FULLTEXT搜索时遇到问题。 I create query: 我创建查询:

SELECT searchTag, MATCH (searchTag) AGAINST ('after party') as score FROM post WHERE MATCH (searchTag) AGAINST ('after party') ORDER BY score DESC

Its result: 结果:

 1. we,like,to,party 3.6987853050231934 
 2. f,w,g,party 3.6987853050231934
 3. after,party,tooka 3.657205581665039

Why number 3 have lower score if it have two words searching? 为什么3号有two words搜索时分数lower

after is a stop word. after是一个停用词。 It is ignored by a FULLTEXT MATCH query. FULLTEXT MATCH查询将忽略它。

Basically, the word "after" is so common in the English language that including it in a query is semantically meaningless. 基本上,单词“ after”在英语中非常常见,以至于在查询中将其包括在语义上是没有意义的。

Think of it this way: imagine a query against the word "a". 这样想:想象一下针对单词“ a”的查询。 There are so many sentences which use the word "a", that a match against them really won't provide you with anything useful. 使用“ a”一词的句子太多了,以至于与它们的匹配实际上不会为您提供任何有用的信息。

In this post, all of the sentences reference the word "a". 在这篇文章中,所有句子都引用单词“ a”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM