views:

18

answers:

1

I would like to know if there is a way I can select the relevance score as a column? So I can store for later manipulation

Also is there any way (for trouble shooting) to determine why a row got a relevance? or what words matched. For example when I use WITH QUERY EXPANSION I am getting results and I do not know why they match.

+3  A: 

Re 1) yes. See the examples in the mySQL docs:

mysql> SELECT id, body, MATCH (title,body) AGAINST
    -> ('Security implications of running MySQL as root') AS score
    -> FROM articles WHERE MATCH (title,body) AGAINST
    -> ('Security implications of running MySQL as root');
+----+-------------------------------------+-----------------+
| id | body                                | score           |
+----+-------------------------------------+-----------------+
|  4 | 1. Never run mysqld as root. 2. ... | 1.5219271183014 |
|  6 | When configured properly, MySQL ... | 1.3114095926285 |
+----+-------------------------------------+-----------------+
2 rows in set (0.00 sec)

Re 2) No, not to my knowledge.

Check out the comments on the manual pages, there are several gotchas that may explain why one is getting zero results on a query that should return more than that.

Pekka