Skip to main content
1 of 2
merlin
  • 313
  • 1
  • 7
  • 17

mysql match against with same score on different input

I am trying to find the nearest match against a given name with mysql. The scoring is for the first two results the same, but looking at it I would rather get the second one as it fit's the name almost.

SELECT ID, name, MATCH (`name`) 
AGAINST ('Superocean Héritage 42mm' IN BOOLEAN MODE) as `score` 
FROM cat_names cs 
WHERE MATCH (`name`) AGAINST ('Superocean Héritage 42mm' IN BOOLEAN MODE) 
ORDER BY `score` DESC

The result:

Superocean Héritage     6.3744072914123535

Superocean Héritage 42  6.3744072914123535

Superocean Héritage 46  6.3744072914123535

Is there a way to tweak the query in order to retrieve the second result correctly?

merlin
  • 313
  • 1
  • 7
  • 17