Finding documents relevant with respect to the search query When search engine receives a query, first of all it looks for a set of candidate documents that contain keywords from the query. Later these documents will be ranked and re-ranked so that eventually top-10 best documents will be presented to the user. The implementation of the first retrieval stage is usually based upon inverted index data structure. You need to implement inverted index data structure and find documents matching Boolean search queries.