Comments - Full-Text Index Overview

4 years ago Ervin Ruci

I have a table called memname_AU (name varchar(100)) with two values:

| WEST STREET |
| WEST PYENGANA ROAD |

The following seems to be a bug: (it does not match the full input)

MariaDB [geocoder]> SELECT name FROM memname_AU WHERE MATCH(name) AGAINST('West PYENGANA') order by cctn desc limit 1;
+-------------+
| name        |
+-------------+
| WEST STREET |
+-------------+
1 row in set (0.026 sec)

MariaDB [geocoder]> SELECT name FROM memname_AU WHERE MATCH(name) AGAINST('PYENGANA') order by cctn desc limit 1;
+--------------------+
| name               |
+--------------------+
| WEST PYENGANA ROAD |
+--------------------+
1 row in set (0.001 sec)
 
4 years ago Ian Gilfillan

This doesn't appear to be a bug, as your first query matches against "West" as well, and you specify LIMIT 1, so only the one result is returned. (The space is stripped out, so the search is for the word "West", or the word "PYENGANA").

If you want both words to be present, you can use something like:

SELECT name FROM memname_AU WHERE MATCH(name) AGAINST('+West +PYENGANA' IN BOOLEAN MODE);
 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.