Page 1 of 1

Full Text sort order question

Posted: Wed Jun 29, 2005 4:44 am
by AGISB
I am using following full text serach

Code: Select all

SELECT GID, Descript FROM Ingrediences WHERE MATCH(Descript) AGAINST ('Apple')
The list contains all kinds of Apple entries that I like to be sorted by string length.

Apple as shortest should be on top followed by e.g. "Apple, fresh" and "Apple, fresh tinned"

Can that be done by the query or do I have to resort in php?

Posted: Wed Jun 29, 2005 4:59 am
by Weirdan
Probably

Code: Select all

... ORDER BY LENGTH(Descript)

Posted: Wed Jun 29, 2005 8:18 am
by AGISB
It really sucks to own multiple 1000 page MySQL Books that never mention LENGHT

Thanks