Think of a normal book. It’s a “forward index”: you go to a page number (like a Document ID) and you find a collection of words (the content).
Forward Index: Page 50 → “The cat sat on the mat.”
An index at the back of a book is an “inverted index”. It’s the reverse. You look up a word (a Term) and it tells you all the pages (Document IDs) where that word appears.
Inverted Index: cat → Pages 50, 62, 101
We wish to build an inverted index such that…