Advanced query with MySQL Match Against -
is possible using match / against match keyword, not if appears in specific phrase?
for example, if want match "dog" not "hot dog":
"this dog" should match.
"this hot dog" should not match.
"a hot dog not dog" should match because second "dog" not part of "hot dog".
my application searches hundreds of keywords defined user in large db (~100k records), performance of query important.
edit: match whole words only, not keywords appear part of word.
if first replace
ocurences of hot dog
with ''
, carry out match
'dog'
on result should getting there. like:
select * mytable match (replace(mycol,'hot dog','')) against ('dog');
just tried out , match
seems work differently. requires fulltext index exist on target columns , can named arguments of match
function. hence: my approach not work. about
select * mytable replace(mycol,'hot dog','') '%dog%';
ok, maybe help
select * mytable replace(mycol,'hot dog','') regexp '[[:<:]]dog[[:>:]]'
in finding cases 'dog'
separate word?
Comments
Post a Comment