Wikipedia
Search Engine
A search engine built from scratch over Wikipedia's law articles: a crawler, a classic keyword index and two neural indexes, with an app that runs one query against all three so you can see how lexical and semantic search differ.
my part: the crawler that built the corpus
Keywords or meaning?
BM25, the scoring behind classic search engines, matches the words in a query. Dense retrieval embeds the query and every passage as vectors and matches on meaning instead. The project builds both over the same corpus and puts them side by side, along with a second neural model: generic bert-base-uncased against msmarco-distilbert-base-v4, which was trained for search.
Crawl, index twice, search.
The crawler was my part. It started as a depth-first crawl that wandered off topic quickly. Switching to a breadth-first queue with depth priority kept it close to the starting article and raised the share of law pages. A stricter category filter improved relevance further but slowed the crawl too much to keep.
The corpus in numbers.
Dense indexing time grows with the corpus
Embedding the MS MARCO model's passages took about 1.2 seconds per page, close to linear. The whole Lucene index built in well under a minute, which is the practical trade-off between the two approaches.
What I'd do next.
Measure relevance, not just speed
The project timed every index but never scored result quality. A set of labeled queries with precision@k or nDCG is the missing piece for saying which engine is better.
Deduplicate before indexing
Redirect pages were saved as separate documents, so the same article could appear several times in BM25 results. Resolving redirects at crawl time would fix it.
A fair baseline
Generic BERT isn't trained for retrieval, so it's a weak opponent for the MS MARCO model. A retrieval-tuned model of similar size would make the comparison sharper.
Crawl politely
The crawl ignored robots.txt. A rerun should respect it, or use Wikipedia's database dumps, which are the intended way to get text at this scale.