Design details of Audiogalaxy.com’s high performance MySQL search engine
spiteful.com
spiteful.com
I can speak from experience on a very large search engine (not on a google scale in # of docs, but within an order of magnitude - and google scale in terms of qps [estimated - google doesn't publish such numbers])
Re: "sharding the index across multiple servers" - every document has an id, mod the id against some number (preferably much larger than the number of partitions/shards you have), split you index servers into N clusters, assign mods to a cluster (do so in a way that you avoid hotspots), have a "query aggregator" that sends an incoming query to one server in every partition. the aggregator then merges the result sets and resorts based on a sort key passed by the search node.
Re: "hash table of words that wouldn’t fit in memory" - the vocabulary I had to work with included at least 7 (human) languages with _many_ artificial words. The # of hash entries tended to hover around 2.7M tokens. How, do not include numbers in the index (there's an infinite number of them :)), ignore case, and tokenization. Tokenization is relatively easy except for CJK languages for that either have fluent/native speakers define the tokenizing semantics or find/buy a library.
So, if you want to search for, say "microsoft windows", the aggregator just sends something like "PHRASE('microsoft', 'windows')", each query node finds the document vector/set for microsoft and the document vector for windows and does an intersection of the doc ids, then the node has to do scan that set, grab the document position array from each document and filters out any documents where windows doesn't occur at microsoft-Positions + 1.
All of the conjunctions, disjunctions, wildcard expansions, near operations, and phrase operations, etc are executed on the query node. All of the complex sort evaluation also happen on the query node. The aggregator only merges result sets and and performs any necessary global sorting.
I was there from 1999 to 2002. It was exceptionally good at finding rare music, at least partially because we never partitioned our network. When you searched, it searched all 1 million+ users that were currently running the Satellite.
Audiogalaxy was simply wonderful. Even now, I would still say it's better than current P2P offerings.
You could find so much.. and the client was so very lightweight!
And I loved being able to control my home client from work through a web interface.
email me for an invite