well you could develop your own SE,but obviously you cant expect it to work like that of google or major search engines...their algorithms are secrets well kept!
Different engines vary But mine does this. 1.) Crawler... Does nothing but get links of pages 2.) Indexer gets the links from the crawler and then does the work It breaks down the site into simple text and gets the most occurring words usually 0.9 - 4.5% It excludes words like the, an, and, it so it can become more accurate. Words in special formats get higher ranked then others so if you have the phrase "Buy Shoes Online" and it only shoes up once but its in a head tag it would be like it showing up multiple times without any formatting ( hope that makes sense ) of course there is a lot lot lot lot more. 3.) the search rank is pretty secret but it takes into account links anchors text, and actual document content giving it a quality score.
page rank has nothing to do with ranking in google (SERP) I have seen so many websites with zero page rank and still doing well in Search Engine.
Basically the search engines crawlers parse out the websites from top to bottom to collect updated information from the websites. These crawlers or bots are smart enough while performing these processes.
Search engines also check if the search keywords appear near the top of a web page, such as in the headline or in the first few paragraphs of text.