Implement index construction and query answering