Way to get index or offset of particular key in a view?

Is there a way to find how many rows are before or after a given key in a view?

For example, with the leaderboard example, is there a way to find the overall rank of a certain player?


The only way to get the number of document returned y a specific query is to count them inside your application.

The value “total_rows” is the total number of rows in the index (so with no parameter)


Great blog post on how to get a ranking with views: