Page 1 of 1

Ordering results form a DB on no. of words found

Posted: Wed Jun 09, 2004 1:38 am
by Calimero
Problem:
User inputs several words, but results are maybe with all of them or with less words that matched fields in the database...

What is the CODE for ordering the results based on how many words from the textfield-input have been found = as a the criteria

Is this done trough MySQL or PHP?

Thanks ahead.

Posted: Wed Jun 09, 2004 8:50 am
by markl999
If you use a mysql fulltext search then you can order the results by 'relevance'. That's not the actual number of words found but how relevant each of the results are using the search words given.