> SELECT id, titel, MATCH (titel) AGAINST ('moz*' IN BOOLEAN MODE) AS > score FROM cmp_composities WHERE MATCH (titel) AGAINST ('moz*' IN > BOOLEAN MODE) > +------ > +------------------------------------------------------------------- > +-------+ > | id | titel > | score | > +------ > +------------------------------------------------------------------- > +-------+ > | 3422 | Variaties en Fuga op een thema van Mozart, opus 132a, voor > piano. | 1 | > | 2692 | 11F?nf Variationen ?ber das Lied 'Komm, lieber Mai' von > Mozart. | 1 | > +------ > +------------------------------------------------------------------- > +-------+ > Now, the score is 1 no matter what (boolean) search i do the score now > always return 1 > > This seems not the intended behavior? is is not possible to get the > score on BOOLEAN searches? That would explain why it doesn't sort on > score... but perhaps the documentation should say you don't get scores > with boolean searches... > > or am i mistaking, in which case i take back my words... > > runnning mysql 4.0.20 on os x server 10.3.5 > > thx 4 any help
Hi there, The problem you are seeing is that full text searches require a pattern of 4 characters or more, so "moz" will not be sufficient to allow a full text search. You can drop this to however many characetrs you want, see the section on tuning full text searches in the manual. However, once you do that you will still notice that the relevance returned by "match" is not much use for sorting when using a boolean search (again, it might always be 1) The way around this is to sort by a non-boolean version of the same match, but limit by the boolean one. SELECT id, titel, MATCH (titel) AGAINST ('moza' IN BOOLEAN MODE) AS score FROM cmp_composities WHERE MATCH (titel) AGAINST ('moz*' IN BOOLEAN MODE) ORDER BY MATCH (titel) AGAINST ('moza') -- -S -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]