Using ASP to make a powerful search engine to large flow

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

don't know when you surf the internet noticed no: Some content-rich sites, the total built a content search engine; some large commercial web sites or integrated sites, are equipped with powerful web search engines, such as Sohu, Sina, Yahoo and so on. Its convenient search query function so far left people with indelible impression, you just type in the keywords you want to browse the data (such as: Web page), a "search" button, the "page" of the list of information presented in front of you; This is just the basic function of the search engine-search queries.





The author is now specialized in the construction of Web sites, using the most commonly used development language--asp search engine powerful features! Below I on the main components of the search engine and some of the functions of the implementation code to explain to you, what are the deficiencies please give points!





in this chapter, I introduce the components and main functions of the search engine.





search engine composition, roughly divided into three parts:





1, interface: This part is mainly customer-oriented, is the part that can be seen, such as you open search.sina.com.cn afterwards see the page.





2, Program: This part is mainly to execute code, according to the customer's search requirements to execute code to obtain search results; These are the things we can't see.





3, Database: All search engines can not be separated from the database, even the famous google.com is no exception; The database is the warehouse that stores the search data, the more storage, the more data will be searched, which is also one of the shining points of the search engine is strong.





so the search engine is strong and other shining point, what is it? Yes, the search engine database in the storage of more data, we can not easily find a search, or even find the necessary information, then the database is "dead", useless, so the program code plays a very important role.





here, I should introduce some of the main features of search engine:





1, search query: There is no doubt that this is the most basic function, according to the keyword to find the relevant information to match the keyword.





2, pagination display: If you're searching for a lot of information, put it all on one page, and that feels like a mess. Pagination shows that according to People's habit of reading, part of the content on the first page, the other content on the second page, the third page and so on.





3, search statistics: generally include the number of inquiries, several pages, each page contains several materials, the current page data range and so on.





4, search results choreography: Search Rankings I think we will not be unfamiliar, these are integrated web search engine to earn money, which is also a powerful search engine of the indispensable function, such as according to the number of clicks, according to the ranking, according to the ranking.





5, a number of keyword query: "If you want to find information containing multiple keywords, you can use the space to separate the keywords" This is the Sina search engine layout in a paragraph of text, in a text box to hit multiple keyword search information.





6, the overall statistics: This is the search engine opened to date some data statistics, including the "Hot query keyword" Statistics, the database in the overall statistics, the data contained in each category and so on.





above the functional code mainly according to the author's request to write, you can write in my code to make changes to become your own needs of the functional code.





well, after a section of warm up, we can also enter the actual combat phase, first, we build a database, as data storage, here I will be the database file name Information.mdb, use Access to create a database, of course, you can also use SQL Server Create。





set up four tables: www (storage data), sort (large Class), SAMLL (small), key (query keyword)





1, www table: ID---Automatic number, sitename---site name, url---site links, FAQ---Brief description, Key---keyword, time---add times, Level---site grade, SortID---Class I D, smallid---Small class ID, hot---site hits.





2, sort table: ID---autonumber, sort





3, SGT Table: ID---autonumber, Sgt





4, key table: keyname---keywords; keyhot---occurrences





uses ASP to establish the connection with the database: conn.asp





Description: The path represented by Server.MapPath () is the relative path of the file, where I conn.asp and Information.mdb in the same directory. I think these are very simple, it is easy to understand and accept! Well, when we build the database, we can build powerful search engines. Please look forward to Oh! Xi Hee ~ ~ ~ ~ ~





use ASP to make powerful search engine--fuzzy search





searches for relevant data based on a keyword, where "related" means a string similar to the keyword in the data. For example: "Shandong" this keyword, as long as the data in the database contains "Shandong" the key word to find them out. The application of fuzzy search is actually very simple, as long as the use of a SQL statement can be implemented, let's look at the wording of his statement.





In SQL syntax you will find such a few judgment words: like, not like, and inclusive. The like decision word is a very useful symbol. However, in many cases it may give you too much data, so it's a good idea to think about what data you want to get before you use it. Not-like is the opposite way. Inclusive Suppose you want to take out a certain range of data, and you know the beginning and end of the range, then you might as well use inclusive to judge the word. These judgment words according to different environment use, the most commonly used is like and "%" combined.





Dim Sql,key





key=request ("key")





sql= "SELECT * from www where sitename like '% ' &key& '% ' or FAQ like '% ' &key& '% ' or key like '% ' &ke y& "% '"





Description: The purpose of the SQL statement here is to retrieve whether the SiteName field in the database contains key, whether key is included in the FAQ field, and whether key is included in the key field, so that the scope of the search is included in the "Site name", "Site brief description", " Site keyword. If you only want to search for keywords just use sql= "select * from www where key like '% ' &key& '% '" is OK. "Like" is used "or" to connect, "or" "or" means that, regardless of which kind is eligible, the search data output should be displayed.





OK, now it is not necessary to see whether the implementation or the results of implementation, because the search engine most of the functions of the implementation of the SQL statement is written. And so I put the other related SQL statement function implementation after introduction, we look at the effect, hehe! Don't worry!! Can you look at my station http://www.361dh.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.