Redian新闻
>
why this full-text search doenst work properly?
avatar
why this full-text search doenst work properly?# Database - 数据库
L*r
1
there is a sentence "┬╗ Site Searches and Difficult " in a text field, but
when I use full-text search to search, it cant return the right result. why?
mysql> SELECT id,data FROM reviews WHERE MATCH (data) AGAINST ('difficult')&
& ma
tch(data) against ('and');
Empty set (0.00 sec)
mysql> SELECT id,data FROM reviews WHERE MATCH (data) AGAINST ('Difficult ')
&& m
atch(data) against ('and');
Empty set (0.00 sec)
mysql> SELECT id,data FROM reviews WHERE id=5039010;
+---------+-----------------------
avatar
y*r
2
is your table MYISAM?
why you put whitespace after Difficult in your 2nd query?

but
why?
)&
')

【在 L******r 的大作中提到】
: there is a sentence "┬╗ Site Searches and Difficult " in a text field, but
: when I use full-text search to search, it cant return the right result. why?
: mysql> SELECT id,data FROM reviews WHERE MATCH (data) AGAINST ('difficult')&
: & ma
: tch(data) against ('and');
: Empty set (0.00 sec)
: mysql> SELECT id,data FROM reviews WHERE MATCH (data) AGAINST ('Difficult ')
: && m
: atch(data) against ('and');
: Empty set (0.00 sec)

avatar
L*r
3
how do I know if the table is myisam?

difficult'
Difficult

【在 y****r 的大作中提到】
: is your table MYISAM?
: why you put whitespace after Difficult in your 2nd query?
:
: but
: why?
: )&
: ')

avatar
L*r
4
well.
I used
select * from reviews where ((data like '% and$%')||(data like '% and %')||(
data like '%^and %')) && ((data like '% difficult%$')||(data like '%
difficult %')||(data like '%^difficult %'));
seems OK, right?

difficult'
Difficult

【在 y****r 的大作中提到】
: is your table MYISAM?
: why you put whitespace after Difficult in your 2nd query?
:
: but
: why?
: )&
: ')

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。