Search engine technology core revealing (PHP)

zhaozj2021-02-16  36

Search engine technology core revealing (PHP)

Editor's note: This is a wonderful programming article, not only analyzes the principles of search engines, but also provides some ideas for using PHP to prepare search engines. The whole article is deeply in-depth, I believe that no matter whether it is a master or a rookie, it can get a lot of inspiration. When talking about web search engines, most people think of Yahoo. Indeed, Yahoo has created a search era of an internet network. However, Yahoo's technology currently used for searching web pages is not the company's original development. In August 2000, Yahoo used the technology of venture companies created by Google (www.google.com). Reasons are very simple, Google's search engine is more frequent and more accurately searching for the technology, more accurate search engine. Let us design it yourself, develop a strong, efficient search engine and database, I am afraid in a short period of technology, funds, etc., but since Yahoo is using others, then we can use others. Search engine website? Analysis of the programming idea we can envision: Simulate a query, send a search command to a search engine website, then return to the search result, analyze the results of the HTML code, strip unnecessary characters and code, and finally press the required needs The format is displayed in our own website page. In this way, the key to the problem is that we have to select an accurate search information (so our search will be more meaningful), fast speed (because we analyze search results and display an additional time), search results are simple (easy Search website for HTML source code analysis and stripping), due to the various excellent features of the new generation of search engine Google, here we choose it as an example, let's see how to use PHP to implement the background to google (www.google.com) search, Personalization of front desk shows this process. Let's take a look at the composition of Google's query commands. Enter the www.google.com website, enter "ABCD" in the query bar, click the query button, we can find that the browser's address bar becomes: "http://www.google.com/search?q=abd&btng=google % CB% D1% CB% F7 & HL = zh-cn & lr = ", it can be seen that Google is passed through the GET method of forms and submits the query command. We can use the file () function in the PHP to simulate this query process. Understand the File () function syntax: array file (string filename); return value is an array, read all the files into the array variable. The file here can be local or remote, and remote files must indicate the protocol used. For example: result = file ("http://www.google.com/search?q=abd&btng=google

转载请注明原文地址:https://www.9cbs.com/read-21757.html

New Post(0)