build inverted index for basic search engine