<%@ Language="VBScript" %> <% Option Explicit %>

This is the search page of the sample web content for ASP 101's Index Server article.

Queries that should return results include: component, cookie, database, date, time, email, form, search, etc.

<% Dim strQuery ' The text of our query Dim objQuery ' The index server query object Dim rstResults ' A recordset of results returned from I.S. Dim objField ' Field object for loop ' Retreive the query from the querystring strQuery = Request.QueryString("query") ' If the query isn't blank them proceed If strQuery <> "" Then ' Create our index server object Set objQuery = Server.CreateObject("ixsso.Query") ' Set it's properties With objQuery .Catalog = "IS-Sample" ' Catalog to query .Query = strQuery ' Query text .MaxRecords = 10 ' Max # of records to return ' What to sort records by. I'm sorting by rank [d] ' which is [d]escending by how pertinent Index Server ' thinks the result is. This way the most applicable ' result should be first. .SortBy = "rank [d]" ' Which columns to return. Column names must ' be the same as the catalog's properties. Some ' of them are: contents, filename, size, path, ' vpath, hitcount, rank, create, write, DocTitle ' DocSubject, DocAuthor, DocKeywords... .Columns = "filename, path, vpath, size, write, " _ & "characterization, DocTitle, DocAuthor, " _ & "DocKeywords, rank, hitcount" End With ' Get a recordset of our results back from Index Server Set rstResults = objQuery.CreateRecordset("nonsequential") ' Get rid of our Query object Set objQuery = Nothing ' Check for no records If rstResults.EOF Then Response.Write "Sorry. No results found." Else ' Print out # of results Response.Write "

" Response.Write rstResults.RecordCount Response.Write " results found:

" ' Loop through results Do While Not rstResults.EOF ' Loop through Fields ' Formatting leaves something to be desired, ' but it'll work for now. We'll pretty things ' up and link to the content in part II. For Each objField in rstResults.Fields Response.Write "" Response.Write objField.Name Response.Write ": " Response.Write rstResults.Fields(objField.Name) Response.Write "
" Next ' Spacing between results Response.Write "
" ' Move to next result rstResults.MoveNext Loop End If ' Kill our recordset object Set rstResults = Nothing End If %>
Bitte geben Sie die Begriffe ein,
nach denen gesucht werden soll:


Bitte beachten Sie die geänderten "Tipps zur Suche"

Zuletzt neu eingestellte Beschlüsse

Search this site  powered by FreeFind