Inverted index for query search