last day (15 days later) » 

5:57 PM
1
A: Mysql not ranking results, fulltext

CommuSoftYou never specify that the results must be ordered, you simply put an additional constraint on the result that there must be a match. You can solve this with the following query: SELECT keywords, title, MATCH (keywords) AGAINST ('more test') AS relevance FROM database WHERE MATCH (keywords)...

 
i get the following: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Match(keywords) Against ('more test') AS relevance FROM database WHERE Match(ke' at line 1
 
Can you give the column number?
 
are you talking about the "keywords" column? If so its column 3
 
@BubblewrapBeast: No the location in the row where the error occurs. Since the line is quite long, it is hard to debug it entirely.
 
It seems to be working now, i retested it with the code you edited. But it is still showing in the wrong order. Like the original problem. Thanks a lot for this btw.
 
5:57 PM
@BubblewrapBeast: what numbers are mentioned in the relevance column?
 
It wasnt working because i added a * rather than keywords, title so it bugged out. Relevance shows "0.6852666139602661" for both results
keywords in first are "test", and in second row is "test some more" i have tried this with other words also
 
@BubblewrapBeast: what if you disable the stopwords filter? See updated answer...
 
i have tried it with other terms, like "hoops stand" with 2 results 1 "stand with hoops" and other result to be "hoops yeah" and still not ranking properly.
 
are you definitely sure that the text is entered in the "keywords" column?
(no offense, but sometimes I find myself doing some silly thinks that had nothing to do with the original problem).
 
positive, as i can see in the results it showing the words under and in the keywords column
i don't understand how the relevancy can be the same? unless it is only looking at the first word maybe and ignoring the second?
 
6:02 PM
well, i'm setting up a database on db4free to test some queries
 
Awesome thanks a lot buddy,
 
When I execute the code with "hoops" and "yeah" I got:
stand with hoops 0.0906190574169159
stand with hoops 0.0906190574169159
hoops yeah 0.000000001885928302414186
hoops yeah 0.000000001885928302414186
(inserted each row two times by accident)
so apperently it works at db4free
query is:
SELECT keywords,
MATCH (keywords) AGAINST ('hoops stand') AS relevance
FROM foo
WHERE MATCH (keywords) AGAINST ('hoops stand')
ORDER BY relevance DESC
(used table foo)
did you run FULL TEXT on your keywords column?
ALTER TABLE foo ADD FULLTEXT index_name(keywords);
 
yeah
let me try 1 more time
 
and foo was:
keywords
stand with hoops
hoops yeah
stand with hoops
hoops yeah
sorry this is of not much help, but I it's hard to debug something, if you don't find any bugs :(
 
Hmm, can you test one more thing for me cause it seems to be working now
 
6:16 PM
sure
 
So i changed the wording a little as i was messing around with this, the term i was using was "hoops ass" and the keywords column had #1: "hoops son" #2: "hoops with some ass"
this is what i was getting the problem with
could you try it that way and see if it works for you
could be it ignores the word "ass"
 
got: keywords relevance Descending 1
hoops with some ass 0.6055193543434143
stand with hoops 0.000000001885928302414186
hoops yeah 0.000000001885928302414186
stand with hoops 0.000000001885928302414186
hoops yeah 0.000000001885928302414186
hoops son 0.000000001885928302414186
 
what the fuck..., now i'm really confused.
 
but perhaps your database has an "offensive language filter", if you run:
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DEFAULT_STOPWORD
you get the list of ignored words
perhaps someone entered additional words
 
Unknown table 'INNODB_FT_DEFAULT_STOPWORD' in information_schema
No worries, ill work out how to find this! Thanks a lot for all the help
 
6:24 PM
well I guess, this is the solution (as I used a blank new db server)
so I guess you must have configured something wrong
 
6:39 PM
@CommuSoft can't find the stopword file anywahere on phpmyadmin even manually looking for it in information_schema
 

last day (15 days later) »