How Search Engine Works?

Ever wonder how search engine reacts against any search query? or How search engine works? Search…