MySQL Forums
Forum List  »  Full-Text Search

Ranking results based on most common phrases - How?
Posted by: Balazs Wellisch
Date: August 12, 2008 10:56AM

Hi all,

I've been trying to come up with a solution to the following problem without luck. Please let me know if this is possible to do with MySQL.

I would like to find the most commonly occurring words (or phrases) in a field in my database table. For example, my structure might look like this...

CREATE TABLE `test` (
`question` VARCHAR NOT NULL DEFAULT '',
FULLTEXT `Index_2`(`question`)
)

My data might look like this...

Row Question
------------------
1 This is a sample question.
2 This is another question.
3 Red fox ate the gray rabbit
4 Question four

The results I'm looking for would be...

Occurrence Keyword
------------------
3 question
2 is
2 This
etc.

The results would be ranked based on the number of occurrences of each word in the database. Ideally, I'd like to do this with phrases, not just words too. (I'm not sure how to define phrases, except to say that they may be multi word combinations)

I'm assuming I'd have to use full-text search for this, but I couldn't find a way to do it. Is there a way to get this done?

Any help, pointers, hints would be much appreciated!

TIA!

Balazs

Options: ReplyQuote


Subject
Views
Written By
Posted
Ranking results based on most common phrases - How?
6415
August 12, 2008 10:56AM


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.