API: field _id gets the message_id, but how to get the index for further reference?

API: field _id gets the message_id, but how to get the index for further reference?

I’m performing searches in a cronjob, and store the message_id. Now it seems as if I’d need the index where the message gets stored.

In the end, I’d like to store a kind of permalink like https://graylog2.example.com/messages/{index}/{message_id}

Thanks.