Indexing for labels of knowledge base