Microsoft KB Archive/243191

= An Example Search Results Page for Site Server Search =

Article ID: 243191

Article Last Modified on 10/14/1999

-

APPLIES TO


 * Microsoft Search, when used with:
 * Microsoft Site Server 3.0 Standard Edition

-



This article was previously published under Q243191



SUMMARY
A basic search results page for Site Server Search can be constructed in relatively few lines of code. This article provides code for an example of such a page.



MORE INFORMATION
<%@ Language="VBScript" %>   <% ' Create our Query object Set objQuery = Server.CreateObject ("MSSearch.Query")

' Set the name of the catalog we are going to execute the query against objQuery.Catalog = ""

' Set the query text we are searching for objQuery.Query = ""

' Specify which columns we wish returned in our recordset objQuery.Columns = "Title, DocAddress, Description, Rank"

' If we want the results sorted, we need to specify what our sort criteria will be. ' In our case, we will sort by descending Rank then by Title objQuery.SortBy = "Rank[d], Title"

' Set the maximum number of records we want retrieved in our recordset objQuery.MaxRecords = 100

' We now execute the query and get our results recordset back Set objRS = objQuery.CreateRecordset ("sequential")

' Display the results. Response.Write objRS.Properties ("RowCount") & " documents match the query" Response.Write " "

' Clean up after ourselves by closing our recordset and setting our objects equal to Nothing objRS.Close Set objRS = Nothing Set objQuery = Nothing %>  

Keywords: kbhowto KB243191

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.