This section shows how to control .asp searches. The code displayed here is equivalent in function to an .idq file.
<BR>
<%
if SearchString <> "" then
if NewQuery then
set Session("Query") = nothing
set Session("Recordset") = nothing
NextRecordNumber = 1
set Q = Server.CreateObject("ixsso.Query")
set util = Server.CreateObject("ixsso.util")
Q.Query = SearchString
Q.SortBy = "rank[d]"
Q.Columns = "DocTitle, vpath, path, filename, size, write, characterization"
util.AddScopeToQuery Q, "/Myfiles", "deep"
set RS = Q.CreateRecordSet("nonsequential")
RS.PageSize = 10
ActiveQuery = TRUE
elseif UseSavedQuery then
if IsObject( Session("Query") ) And IsObject( Session("RecordSet") ) then
set Q = Session("Query")
set RS = Session("RecordSet")
if RS.RecordCount <> -1 and NextPageNumber <> -1 then
RS.AbsolutePage = NextPageNumber
NextRecordNumber = RS.AbsolutePosition
end if
ActiveQuery = TRUE
else
Response.Write "ERROR - No saved query"
end if
end if
%>
This section is executed only if the SearchString variable has been set, that is, only if you have typed a query into the form and clicked the New Query button. The section marked in bold contains many of the elements in the sample .idq file in Controlling the Search (.Idq File). Notice the differences in syntax.