Phase 1: Divide searchable documents among index shards

When a search is executed, the system equally divides all searchable documents among 10
index shards. Each shard has a unique list of documents.

To maximize search efficiency, the system creates 10 query threads to simultaneously search
each index shard.

Figure 1. Divide documents among index shards

Phase 2: Search and filter shard documents

Each query thread searches through its list of shard documents to identify documents that
match the search criteria. For example, if you search for "wifi
network," the system returns all documents containing both
"wifi" and "network" in no particular order.

Note: A
multiple word search is equivalent to multiple single word searches connected by an AND
operator. For example,
[contains][wifi][AND][contains][network].

The query thread assigns each matching document a numeric value (a document ID) to uniquely
identify it. All other documents are ignored.

Phase 3: Score shard documents

Phase 4: Merge and sort shard document scores

The system merges the document scores into a single index and sorts the documents from
highest to lowest document score. The documents with the highest document score are most
relevant to the search query.