I set up a mysql table with some fields as a FULLTEXT index.
The mysql crunching is done via PHP.
It works- for the most part.
Here is the issue. I am using an AJAX autocomplete that throws up the results as each character is typed into a text box (This is a search feature). The php program does get called with each character after the first 3 are typed (the php file writes to a log file for each character typed.)
I get results returned for
AGAINST ('+bird' IN BOOLEAN MODE)
AGAINST ('+bird ' IN BOOLEAN MODE)
AGAINST ('+bird +f' IN BOOLEAN MODE)
AGAINST ('+bird +fe' IN BOOLEAN MODE)
AGAINST ('+bird +fee' IN BOOLEAN MODE)
No results for this (The php mysql_num_rows for the "no results" is zero.)
AGAINST ('+bird +feed' IN BOOLEAN MODE)
No results for
AGAINST ('+bird +feede' IN BOOLEAN MODE)
Then results are returned for
AGAINST ('+bird +feeder' IN BOOLEAN MODE)
This is puzzling me to my wits end.
I run the query in phpMyAdmin and get plenty of rows returned for '+bird +feed' and '+bird +feede'.
(Yes, it's the same query php runs - I have that in the log and copy-n-paste into phpMyAdmin).
I can type the characters into the textbox ever so slowly and same result.
Can you see what is preventing no results for the interim searches?
And, how to fix it?
---------- Post added at 11:15 PM ---------- Previous post was at 10:03 PM ----------
I added * at the end of each search term and am now getting results for the no results.
Can anyone explain why I didn't above?
And why results were returned for the first grouping? There is no full word, "fe" or "fee" in the database fields.
And, why the php program returned zero rows when phpMyAdmin would with the exact same query on the same db.
Submit Your Article
Forum Rules

Reply With Quote
