I do n’t know if you do n’t know when you go online: some websites with rich content are built with a content search engine; some large commercial websites or comprehensive websites are equipped with powerful website search engines, such as Sohu, Sina, Yahoo and so on. Its convenient search and query function has left an indelible impression on people. As long as you enter the keywords you want to browse the information (such as: webpage), press the "search" button, the list of information about "web pages" will be presented to you In front of you; this is just the basic function of the search engine-search and query.
The author is now responsible for the construction of online search section in Zhongshan East (http://www.china-sd.net), using the most commonly used development language-ASP to develop the powerful features of search engines! Below I will explain the main component part of the search engine and the implementation code of some of these functions. Please point out if there are any shortcomings!
In this chapter, I will introduce the components and main functions of the search engine.
The composition of search engines is roughly divided into three parts:
1. Interface: This part is mainly for customers, which can be seen. For example, you can open the page you saw after the search.sina.com.cn.
2. Program: This part is mainly executed code, and the code is performed according to the customer's search requirements to obtain the search results; these are what we can't see.
3. Database: All search engines are inseparable from the database, and even the famous Google.com is no exception; the database is a warehouse for storing search data. The more stored, the more information obtained. Whether a powerful sparkling point.
So is there any other shining point for search engines? Yes, no matter how many storage materials in the search engine database, we cannot easily find search, and even find the required information. Very important role.
Speaking of which, I should introduce you to several main functions of the search engine:
1. Search and query: There is no doubt that this is the most basic function. Find relevant information that meets keywords according to keywords.
2. Pagling display: If a lot of information you searched, put it on a page, that it feels like a mess; paging shows that according to the habits of people reading, put some content on the first page. Other content is placed on the second page, the third page, and so on.
3. Search statistics: Generally include query data, divide a few pages, each page contains several materials, the current page data range, and so on.
4. Search results arrangement: Search ranking, I think everyone will not be unfamiliar. These are a measure to earn Money to earn Money, which is also an indispensable function in the powerful search engine. For example Level ranking.
5. Multiple keyword query: "If you want to find information containing multiple keywords, you can separate the keywords with a space." This is a paragraph of the Sina search engine layout. Put multiple keywords in a text box Search for query information.
6. Overall statistics: This is some data statistics for search engines, including "popular query keywords" statistics, the overall statistics in the database, statistics contained in each category, and so on.
The above function code is mainly written according to the author's requirements. You can modify the code I wrote to become the functional code you need.
Well, after a warm -up, we can also enter the actual combat stage. First of all, we first build a database as a data storage. Here I name the database file is included. You can also create SQLServer.
Create four tables: www (storage data), sort (large category), SAMLL (small category), key (query keyword)
1. www table: ID --- automatic number, sitename --- site name, URL --- site link, FAQ --- brief explanation, key --- keyword, time --- add time, level --------- level ------ -Site level, sortid --- large category ID, smallid-small category ID, hot --- site clicks.
2. SORT table: ID --- Automatic number, sort
3. Small table: ID --- automatic number, small, small
4. Key table: Keyname --- Keywords; Keyhot ---
Use ASP to build a connection with the database: conn.asp
Note: The path represented by server.Mappat () is the relative path of the file. I here is in the same directory. I think these are simple, it is easy for everyone to understand and accept! Well, after the database is established, we can build a search engine with powerful functions. Please look forward to it! Hee hee ~~~~
Use ASP to make powerful search engines-blurred search
According to a keyword, search for related information, the "related" here refers to the string similar to this keyword in the information. For example: The keyword "Shandong", as long as the data in the database contains the keywords of "Shandong", find them out. The application of fuzzy search is actually very simple. As long as you use a SQL statement, you can implement it. Let's take a look at his statement writing.