I'm working on the final pset, more specifically on the search.php
file.
I've figured out how to use query()
and I'm actually taking advantage of print(json_encode($places, JSON_PRETTY_PRINT));
to check the results of my matching.
Here's below a picture of my places
table in mySQL:
So I've set up the Index_type
of country_code
, postal_code
, place_name
, admin_name1
, admin_code1
to FULLTEXT
and gave a Key_name
to each of them (in case of they could be eventually necessary).
When I call query()
to SELECT
all rows from my places
table where I MATCH (country_code, postal_code, place_name, admin_name1, admin_code1)
AGAINST $_GET["geo"] IN BOOLEAN MODE
, everything works fine.
Now if I call the same query()
to SELECT
all rows from my places
table where I MATCH (country_code, postal_code, place_name, admin_name1, admin_code1)
AGAINST $_GET["geo"] WITH QUERY EXPANSION
, I always get this:
Fatal error: Can't find FULLTEXT index matching the column list in /home/jharvard/vhosts/pset8/includes/functions.php on line 49
I've tried to replace the Column_name
in MATCH
with the Key_name
but it didn't worked too.
I've checked more than once the dev page relative to Full-Text searches WITH QUERY EXPANSION to be sure I've written my code with the right syntax but despite all my efforts, nothing but IN BOOLEAN MODE
works.
I've also tried everything recommended on this page and guess what? Nothing resolved my problem! :)
Could somebody explain me why IN BOOLEAN MODE
is the only full-text search method to work please?