Practical tips: Create a site map with ASP

Source: Internet
Author: User
Tags include query
Tips | Site Map

In order not to use the user page to find the required information, most large web sites in the prominent place has a search feature, in the text box to enter a few words, so there is a want to see the page. You may not get exactly the page you want, but you can add more keywords and refine your search. This article describes how to build and use site maps through the Index Server service built into IIS.

Before you configure Index server to perform a search on a Web server, you must first create at least one index and follow these steps to complete the work.

⒈ to start the index on the Windows server servers. By default, the Select icon is managed by the computer in the Administrative Tools group, and the interface shown in Figure 1 appears when you start. The right side of the window provides index information about the current presence on the server. There are two indexes by default: System and Web.

⒉ to create a new index, right-click the Indexing Service or the right panel to select a new catalog. Displays the Add Catalog dialog box, specifies the name of the index, and selects the location using the browse button. Indexing Service does not start indexing immediately, a message box pops up, and click OK to continue. For optimal performance, Indexing Service can be placed on a hard disk that is isolated from the Web server.

⒊ the directory for the specified index, right-click the newly created catalog name, and select the property from the pop-up menu, the dialog box shown in Figure 2 appears. The first tab general displays what you just entered, and select the Web site you want to index in the WWW server drop-down list in the Second tab trace.

⒋ has a catalog created and can now pick the directories you want to include in the index. This powerful feature allows you to create several indexes that search for content in different ways. For example, you might want to quickly browse through the chapters that are drawn from the full text, which allows you to perform this task within the Index server. To add a table of contents, right-click the Panel on the right and select New directory. In the dialog box that appears, select the directory by using the Browse button and specify an alias. If you have to log on to the server to get what you need, you can provide the user name and password that will be used to get what you need. If you want to check for protected content, it is useful to maintain the security of the content, so that only authorized users, perhaps those who pay for it, can get the full content.

The

can also use this tool to exclude subdirectories in a Web site that you do not want to index. For example, retrieving the scripts/cgi directory will not be helpful to the user. To do this, simply double-click the directory to include the selected as No in the index.

⒌ The Index Server service by right-clicking the right panel, selecting Startup from the pop-up menu, after all catalogs have been included/excluded for the site. The server starts browsing the indexes that have been created and starts retrieving the content. The

creates a simple search page search page that is divided into two parts, the data entry form and the search results form. The list of programs is as follows:

 
     
    Index Server Demo    
   
     > search: 
    
     <% If Request ("Txtquery") <> "Thendim Objquerydim Rsqueryset objquery = Server.CreateObject ("Ixsso.") Query ") Objquery.query = Request (" txtquery ") objquery.columns=" filename,vpath,doctitle "Objquery.catalog =" E:\ INETPUB\WWWROOT\QHMOLSS "Objquery.maxrecords = 50Set rsquery = Objquery.createrecordset (" nonsequential ") If rsquery.eof Then%>
     <%else%> 
     
  
   
       <% do, not rsquery.eofif rsquery ("DocTitle ") <>" "Then%> 
      
    <% End Ifrsquery.moven Extloopresponse.write " 
   
" ><% = Rsquery ("DocTitle")%>
" End IfEnd If%>

When you run the program for the first time, because the txtquery variable is empty, so that only the data entry form for the program is displayed, if you enter the query word "Qinghai province", the program calls itself to display two forms.

Program description in this program, the query object is the center of the search engine, which talks directly to the Index server engine to retrieve the data.

In order to return any results, you must set several key properties: Query, Columns, and catalog. This article uses the MaxRecords property, but does not require that it be used. The query property is used to store search criteria, in which case the data Entry Form text box can be placed on one page. The Columns property stores the columns that are returned from the query, and the names of the columns are fixed. The last property that must be set is the Catalog property, which specifies the directory in which the index resides.

Once the Catalog object is populated, an ADO recordset is created from the query. This recordset, like the recordset created from the database, can be navigated in the same way.

The rest of the code is used to display the results. After you create the table (with only one column in the example), iterate through all the records. You can select files that have only headers, because Index Server indexes other types of files (such as graphics files) that do not have to be displayed. In some cases, you may need to display images, but in this case, we only need text documents.

Using the Vpaht and DocTitle parameters, you can build a URL that points to the file you found. The Vpath parameter is the virtual path of the file, and the Docttitle parameter is the title of the document. For HTML documents, this is the value between the tags of the file. For other types of documents, the title changes depending on the location of the storage.</p>



Related Article

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.