Hi,
I'm desperately trying to create a relatively concise search engine with PHP, mySQL and PDO. I have a database of books, and I'm trying query a search against two of the fields. Here is what I have so far:
"SELECT id, title, author, isbn, MATCH(title, isbn) AGAINST (:term) AS score FROM %sbooks WHERE MATCH(title, isbn) AGAINST (:term) AND is_active = 'y' ORDER BY score DESC LIMIT 0,25");
$sth->execute(array(':term'=>'+'.$keywords));
$keywords is a string from the search field, so could be something like 'Some kind of book'.
I don't want to filter out any words or do anything too fancy, but the above query is ignoring a lot of results, even when I put it IN BOOLEAN MODE.
Also, I have two books in the database, 'book number 1' and 'book number 2'. If I search 'book number 2' then it will still score 'book number 1' higher. The main problem however is that a lot of searches are just returning with no results :(
Could anyway help suggest what I am doing wrong here?
Many thanks