Inverted Index + TF-IDF
Lucene-style search internals: posting lists, skip pointers, term positions, and TF-IDF scoring. Watch step-by-step query execution as documents are iterated and scored.
Query Execution
Enter a query and click "Execute" to see step-by-step execution
Posting Lists
Document Store (8 docs)
The ride matching algorithm uses geospatial indexing to find nearby drivers for riders requesting trips in real time
Search ranking combines relevance scoring with personalization to find the best results for each user query
Driver dispatch optimizes for minimal wait time by matching riders with the nearest available drivers
Real time analytics track ride patterns and driver availability to optimize the matching algorithm
Fare calculation uses distance and time to compute the ride cost with surge pricing during high demand
Driver onboarding process includes background checks and vehicle inspection for rider safety
Route optimization algorithm finds the fastest path using real time traffic data for drivers
Payment processing handles credit cards and digital wallets for seamless ride transactions
Lucene Index Internals
Sorted list of document IDs containing a term. Sorted order enables efficient parallel iteration.
For AND queries: maintain pointers into each posting list. Compare docIds, advance smaller pointer. Match when all equal. O(n+m) time.
Jump ahead when gaps are large. If pointer A is at doc 5 and B is at doc 100, skip A forward using skip list.
For OR queries: walk through both lists, output minimum docId, advance that pointer. Like merge-sort merge phase.
Word positions within documents. Enables phrase queries like "ride matching" (adjacent terms).
Lucene iterates segments, merging results. Each segment has its own posting lists and skip lists.