add factory method to QueryIndex