Web / Apache Solr Interview questions
What is an inverted index in Solr?
An inverted index is the core data structure Lucene, and therefore Solr, uses for fast full-text search. Instead of storing "which terms are in document 5" like a regular table, it stores "which documents contain this term" for every term.
| Forward index | Inverted index |
| doc → list of terms | term → list of docs (postings) |
Each term's postings list can also store positions and frequencies, enabling phrase queries and relevance scoring. This structure is why Solr can search millions of documents for a keyword in milliseconds instead of scanning row by row.
More Related questions...