One method is to use Index Server query object and parameters:
<%
Set Q = Sever. CreatObject ("ixsso. Query ")
'Create a query object.
Set Util = Sever. CreatObject ("ixsso. Util ")
Q. Query = Request ("SearchString ")
'Query the field.
Q. SortBy = "rank [d]"
'Sort by degree of conformity in descending order
Q. Columns = "Doctitle, vpath, filename, size, write, characterization, rank"
'Return record attributes.
Q. MaxRecords = 300
'Maximum number of returned records.
Util. AddScopeToQuery Q, "/", "DEEP"
'Search all subdirectories.
Q. LocaleID = Util. ISOToLocaleID ("ZH-CN ")
'Specify the language in simplified Chinese.
Set RS = Q. CreateRecordSet ("nonsequential ")
'Create an output set.
%>
Another method is to use ADO query object and SQL statement:
<%
Set Conn = Server. CreateObject ("ADODB. Connection ")
Conn. ConnectionString = "provider = msidxs ;"
Conn. Open
Set AdoCommand = Server. CreateObject ("ADODB. Command ")
Set AdoCommand. ActiveConnection = Conn
AdoCommand. commandText = "Select Doctitle, vpath, filename, size, write," & "characterization, rank from SCOPE () where contains ('" & SearchString & "') order by rank DESC"
Set RS = Server. CreateObject ("ADODB. RecordSet ")
RS. open AdoCommand
%>