Implement index querying and add corresponding test application