Match player to the closest to the criteria

Hi, i have some questions regarding matchmaker and criterias,
i have a game where players have to connect to other players in the same skill level.

what i did before was like this, each player has a number which defines their performance,
then this number will be calculated into skills.
0 to 1200 = Beginner
1200 to 2000 = Intermediate
2000 to infinite = Advanced

and then these skills was given to the matchmaking query to find a user with the same range, for example if i’m beginner find me another user that is also a beginner, it doesn’t matter if i’m 500 or they’re 1000 we are in the same range and we should connect.

like this

var query = "+properties.skill:beginner" 

Now i want to make this more specific, and connect the player to the closest performance, for example:

player A,B and C are in the pool, they are all in the same range,

Player A = 500
Player B = 600
Player C = 1000

if you look at it player A and B are closer in range so they should connect to each other, so what i want is no matter how many player are in the pool that have the same criteria, i want to connect the player to the closest to them in range

i can use this but will it guarantee to connect to the closest ???

var query = "properties.skill:>=0 +properties.skill:<=1000";

thanks so much for your help.