Questions tagged [against]
72 questions
1
vote
1 answer
sql Match () Against unrecognized
When I tried this query
SELECT name, cost FROM items WHERE MATCH (name) AGAINST ('baby')
phpmyadmin gives me a warning that states:
Unrecognized keyword. (near "MATCH" at position 43)
Unexpected token. (near "(" at position 49)
Unexpected token.…

Marr
- 555
- 1
- 6
- 11
1
vote
3 answers
MySQL MATCH AGAINST query with long WHERE AND OR syntax?
The following query is not working the way I expect:
SELECT DISTINCT *
FROM mytable
WHERE MATCH (StrNum, StrName, StrType, TownName, Zip) AGAINST ('elm')
AND Color = 'RED' OR Color = 'WHITE' OR Color = 'BLUE'
This is returning more results than…

k00k
- 17,314
- 13
- 59
- 86
1
vote
1 answer
MySql SELECT Query for Multiple Keywords across Multiple Fields
I need some help for the logic of a SELECT query and hope someone can give me a better idea than the one I have.
I have a table like this:
+---------+----------+---------+-----------+
| id | model | variant | category |
…

user3132858
- 609
- 1
- 11
- 27
1
vote
0 answers
php mysql WHERE MATCH AGAINST not working - invalid query?
EDIT: please note this query does not work with four+ letters either
I've been attempting to use the below query unsuccessfully. The problem is not that zero results return, but that the query itself seems to be broken as when I use var_dump to…

tensai288
- 71
- 1
- 8
1
vote
0 answers
Match against search engine
I am trying to determine the best way to use match against in my insite search engine. I want the most efficient and fastest way to do it. I have two choices of sql statements:
SELECT *, MATCH(keywords) AGAINST
('keyword keyword2 keyword3' IN…

Jack Peterson
- 11
- 1
1
vote
0 answers
MySQL "MATCH ... AGAINST" : needle in every column?
I got a problem using MATCH ... AGAINST. Here's a sample table called 'elts'
id | tags | title | description
----------------------------------------------
1 | music | music | music description
2 | test | test | music…

Nicolas
- 1,812
- 3
- 19
- 43
1
vote
1 answer
match.. against
My query is not working, it always show related 0. Even against data do exist.
SELECT number, MATCH(number)
AGAINST('02' '01' '03' WITH QUERY EXPANSION)
as related FROM lottery_entries;
you can see the result below.
i don't know what is…

fkabeer
- 398
- 4
- 15
1
vote
2 answers
MATCH AGAINST multiple words AND OR
I am using fulltext search in a project. I want to search multiple words but i have a problem. So my query is;
SELECT MAX(id)
FROM table
WHERE MATCH (col1,col2) AGAINST ('+(word1) +(word2) +(word3 word4)')
GROUP BY col1
ORDER BY 1 desc limit 12
And…

pheaselegen
- 398
- 1
- 4
- 15
1
vote
1 answer
MYSQL match against query two tables
Is it possible to do a match against a query with two tables using a join? The tricky part might be the index on the table but maybe there is a way.. sql is not my strong suit. Many thanks. I imagine it might be something like the…

user1260310
- 2,229
- 9
- 49
- 67
1
vote
4 answers
PHP/MYSQL match against query
I am trying to run a match against query and it is not working. I created a full text index on the two fields. But am getting sql error right before word 'relationship". Here is sql:
"SELECT * FROM pages WHERE MATCH (shdescript,ldescript) AGAINST…

user1260310
- 2,229
- 9
- 49
- 67
0
votes
1 answer
Why does this SQL query give correct results on my local database, but wrong result on the server database?
On my local MySQL database, this query to search for a specific word "samy" gives me the correct data consisting of two 2 results:
SELECT *
FROM members
LEFT JOIN member_details
ON members.id_members = member_details.id_member
LEFT JOIN…

Samy Reef
- 73
- 1
- 9
0
votes
0 answers
Using a mysql variable as parameter for AGAINST
I am fetching data from an excelsheet using LOAD DATA INFILE statement and trying to evaluate the results before saving to a database. I need to be able to pass one of the fields from the excel as a mysql variable in the AGAINST() function like…

Peter
- 60
- 8
0
votes
1 answer
MySQL MATCH AGAINST on Two Tables Not Sorting by Relevance
I have a stored procedure using MATCH AGAINST that was originally returning data sorted by relevance, which is what I wanted. However, when I added a LEFT JOIN and a second MATCH AGAINST, it is now returning data from both, but no longer sorting by…

qbert
- 119
- 2
- 9
0
votes
1 answer
How To Match String Containing Comma In MySQL
Our DB contains a lot of entries with comma in their titles (as in Hungarian, it's the decimal separator instead of period) and would like to match those with the right relevance. The search SQL looks like this currently in case of the user inputted…

gramgram
- 565
- 3
- 18
0
votes
2 answers
MySql FULLTEXT match against a list of keywords from a lookup table
I don't know if this is possible, but it would simplify my calculations to be able to match against each word in a lookup table with a single query. (otherwise, I'll probably pull the tables into memory and program a sequence of queries in…

ChewyChunks
- 4,449
- 3
- 22
- 14