You can use ZCOUNT
from negative infinity to your specific score to find the index.
For example, in following sorted set:
> ZADD dewey 1 first 3 second 8 third 21 fourth 55 fifth
(integer) 5
To find the index of 21
(the fourth number):
> ZCOUNT dewey -inf (21
3
Just keep in mind that this is 0-based index.