MySQL Forums
Forum List  »  Full-Text Search

[SOLVED] Full-Text Score without Dependency
Posted by: Peter Schmidt
Date: August 09, 2010 08:03AM

Hi,

I can't find the solution for the following problem: I need to order a result by the full-text score but I don't want to make this match an exclusion for other rows that have actually no match in this column. Unfortunately I get a result/full-text score only if I use the MATCH () AGAINST in the WHERE-Condition.

What I'd need to have:
SELECT *, MATCH (FULL_TEXT_COLUMN) AGAINST ('full text words') as FULL_TEXT_RELEVANCY FROM my_table
WHERE OTHER_COLUMN = 'value'
ORDER BY FULL_TEXT_RELEVANCY

What's kind of working (but excludes rows without full text match):
SELECT *, MATCH (FULL_TEXT_COLUMN) AGAINST ('full text words') as FULL_TEXT_RELEVANCY FROM my_table
WHERE OTHER_COLUMN = 'value'
AND MATCH (FULL_TEXT_COLUMN) AGAINST ('full text words')
ORDER BY FULL_TEXT_RELEVANCY

Also not working as intended (FULL_TEXT_RELEVANCY is always 0) :
SELECT *, MATCH (FULL_TEXT_COLUMN) AGAINST ('full text words') as FULL_TEXT_RELEVANCY FROM my_table
WHERE OTHER_COLUMN = 'value'
OR MATCH (FULL_TEXT_COLUMN) AGAINST ('full text words')
ORDER BY FULL_TEXT_RELEVANCY

Thank you for any possible help!



Edited 1 time(s). Last edit at 08/12/2010 02:20AM by Peter Schmidt.

Options: ReplyQuote


Subject
Views
Written By
Posted
[SOLVED] Full-Text Score without Dependency
4167
August 09, 2010 08:03AM
1682
August 11, 2010 11:16PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.