Click to See Complete Forum and Search --> : boolean search question


ixxalnxxi
05-24-2008, 10:49 PM
using mysql version 5.0, i have a field in my database which holds a name, 'My Animal Friends'

i'd like for the results to return the row containing 'My Animal Friends' if the user searches 'animals', however it does not work with my current query. (searching 'animal' does work, however)

how can i change my query so that it is more sensitive to the point 'animals' can return a score for 'My Animal Friends'? here is my following query:

SELECT *,
MATCH (Name)
AGAINST ('+\"$search\"' IN BOOLEAN MODE)
FROM Products
WHERE
MATCH (Name)
AGAINST ('+\"$search\"' IN BOOLEAN MODE)

chazzy
05-25-2008, 09:43 AM
you should probably remove the 's' yourself, and add a wild card.

ixxalnxxi
05-27-2008, 10:00 AM
in my database there's a column 'Name' and a field in that column stores 'Animal Friends'.

using a search feature on my site, how would i set up a query so that 'animals' would also return 'Animal Friends' from the DB? currently i use:

SELECT *,
MATCH (Name)
AGAINST ('+"$search"' IN BOOLEAN MODE)
AS score
FROM Products
WHERE
MATCH (Name)
AGAINST ('+"$search"' IN BOOLEAN MODE) > 0
HAVING Name LIKE '%$search%'
ORDER BY Name, Price, Score

chazzy
05-27-2008, 02:13 PM
you already asked this question.