Get index of item in dataset

I could be wrong here, but I think you are confusing wixData API (which is querying the collection directly) and Dataset which is an element you add to your editor that serves as a connector to the database.

When you use wixData.query() you are querying the database table directly not the dataset element which is where your index from sort should be.

Have you looked at the dataset API ?

Overview of data and dataset