469,950 Members | 2,029 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

Useful Relevance with FullText Boolean Mode - help

Show full header Is there any way to make relevance when using boolean
mode more useful? If not, are there plans in the Fulltext development
"todo" for making it useful?

I'm thinking of just counting the keyword occurences in records with a
PHP script somehow and using that to order the records somehow. Or doing
a non boolean fulltext search w/relevance first and then melding that in
somehow with a boolean search.

See my results below, my "peeps" are asking me for relevance/ranking -
what do I do?
Thanks.

mysql> SELECT `page`.`title` , MATCH ( `title` , `descrip` ) AGAINST (
'nasdac' IN BOOLEAN MODE ) AS Relevance FROM `page` WHERE MATCH (
`title` , `descrip` ) AGAINST ( 'nasdac' IN BOOLEAN MODE )HAVING
Relevance > 0.2 ORDER BY Relevance DESC;
+------------------------------------------------+-----------+
| title | Relevance |
+------------------------------------------------+-----------+
| Code 30 Specifications | 1 |
| Center for Aero Information (CAI) | 1 |
| nasdac Centers | 1 |
| nasdac Electronic Parts & Packaging Program | 1 |
| Report/Document Number Series | 1 |
| misskermit | 1 |
| COSMIC | 1 |
| Consolidated Operations Contract (COC) | 1 |
| Directives | 1 |
| Directory of Project Libraries | 1 |
| nasdac Technical Standards Program | 1 |
| Outstocking Handbook | 1 |
| nasdac Database (NAD) | 1 |
| nasdac test | 1 |
+------------------------------------------------+-----------+
14 rows in set (0.01 sec)
Jul 23 '05 #1
1 2224
leegold wrote:
See my results below, my "peeps" are asking me for relevance/ranking -
what do I do?


You could fetch a field as a non-boolean MATCH result, and use that for
your ordering, even if your WHERE clause limits the rows by a boolean
MATCH result.

SELECT `page`.`title`,
MATCH(`title` , `descrip`) AGAINST ('nasdac' IN BOOLEAN MODE)
AS Relevance,
MATCH(`title` , `descrip`) AGAINST ('nasdac')
AS NonBoolRelevance
FROM `page`
WHERE MATCH(`title` , `descrip` ) AGAINST ('nasdac' IN BOOLEAN MODE)
HAVING Relevance > 0.2
ORDER BY NonBoolRelevance DESC;

As for improvements to full-text searching on the horizon, I don't know
of anything, but you can keep an eye on this page and its sub-pages:
http://dev.mysql.com/doc/mysql/en/todo.html

Regards,
Bill K.
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Matt W | last post: by
1 post views Thread by leegold | last post: by
reply views Thread by Robert Oschler | last post: by
1 post views Thread by Robert Oschler | last post: by
reply views Thread by phillip.s.powell | last post: by
5 posts views Thread by rdlowrey | last post: by
nathj
3 posts views Thread by nathj | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.