Inverted Indexes: A Step-by-Step Implementation Guide
Before we start with the implementation, let's talk about why would you actually need an inverted index in a real life. Why would anyone need inverted index at all Imagine you need to create a system that would quickly look up a document, given several words from it - something like a wiki search. Simplest option I can think of would be to scan through each document, marking ones that have all the necessary words. That might work at first, but such solution wouldn't scale,