MySQL Forums
Forum List  »  Performance

Re: Hyphen in FULLTEXT
Posted by: Jon Stephens
Date: November 16, 2023 08:12PM

I think it's likely that the '-' characters are being interpreted as search operators.

I'm also not sure why you encase the search string with two sets of quotes. Note that single quotes and double quotes cause different behaviour.

MATCH(column) AGAINST('$strings' IN BOOLEAN MODE) is intended to search for text columns in which the string or strings given in AGAINST() are present (+) and/or absent (-). As you're using it here, you might as well just use SELECT value FROM table WHERE value = $string.

See https://dev.mysql.com/doc/refman/8.2/en/fulltext-boolean.html for more info and examples.

Another alternative for finding columns in which a given string is present is to use LIKE--see https://dev.mysql.com/doc/refman/8.2/en/string-comparison-functions.html#operator_like.

cheers

Jon Stephens
MySQL Documentation Team @ Oracle

MySQL Dev Zone
MySQL Server Documentation
Oracle

Options: ReplyQuote


Subject
Views
Written By
Posted
313
November 16, 2023 03:19PM
Re: Hyphen in FULLTEXT
340
November 16, 2023 08:12PM
183
November 18, 2023 10:56AM
188
November 20, 2023 12:12PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.