How to achieve full-text search

Source: Internet
Author: User
Tags microsoft frontpage
How to use ASP to implement Full-text search in the website?
We can create a database that contains file names, file headers, and retrieve files, and then use ADO to access it and set up Recordset objects. See below for specific code and description:
<%@ language= "VBSCRIPT"%>
<meta name= "generator" content= "Microsoft FrontPage 3.0" >
<meta http-equiv= "Content-type" content= "text/html; Charset=gb_2312-80 ">
<title> Full-text search of Spring Breeze </title>
<meta name= "Microsoft Border" content= "tl, default" >
<body bgproperties= "FIXED" bgcolor= "#00FFFF" >
<%
Mousepointer=13
Set Conn1 = Server.CreateObject ("ADODB. Connection ")
Conn1.open "Dsn=intels"
Set rcst1 = Conn1.execute ("SELECT * from Pages_catalogue")
Sch_str=request.form ("Text1")
Doubbytes=len (SCH_STR) 2
Sch_str=left (Sch_str,doubbytes)
' Matches the length of the string. Preprocessing the data obtained by the request (user input useful information), by calculating the length of the effective information to intercept the required string. We can also attach a glyph (such as # or CHR (7)) to the input string after it is processed.
Response.Write "<CENTER> Search results <HR><Br>"
Dim result
Result =false
Response.Write "
"
Do as not rcst1.eof
Tit=rcst1.fields ("File_title")
Fn=rcst1.fields ("file_name")
File_name= Server.MapPath ("/") & "Songchunfeng" & FN
To_find=text_match (FILE_NAME,SCH_STR)
' Opens the file that the current record in the recordset points to. Match the Full-text text of a file with a lookup string to compare
......
Response.Write "<a href=" & URL & ">
"& Tit
End If
Rcst1.movenext
Result=result or To_find
Loop
Response.Write "

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.