Using the Index server-Create an ASP page

Source: Internet
Author: User
Tags query rowcount
Create | server | index | page Create ASP page

Everything gets really cool on the ASP page. You use the values in the form to drive objects that query the index server.

The whole process is like this:

Open the recordset.
With the standard ADO method, step by step through the recordset.

<%
"Create a Query object, initialize it using
"Setqueryfromurl, and dump the object state

"Set the Query object
Set objquery = Server.CreateObject ("Ixsso. Query ")

"Get the" query properties set from the
"Incoming URL (from the form get operation)
Objquery.setqueryfromurl (Request.QueryString)

"Tell the object what columns to include
Objquery.columns= "Filename,hitcount,vpath,doctitle,characterization"

"Open the recordset, causing the query to be
"Executed
Set rsquery = Objquery.createrecordset ("nonsequential")

"Now, if rsquery.eof isn't TRUE, then we have results
"To show. If It is TRUE, no results were found.

"Get the page out for the user ...
%>


A maximum of results is returned hits per page would be shown. <br><br>
<%
If not rsquery.eof then
Response.Write Rsquery.recordcount & "Hit (s) were found."
If Rsquery.recordcount > Then
Response.Write "Want to refine your query."
End If
Response.Write "<br>"
End If
%>

<%
If not rsquery.eof then
While not rsquery.eof and rowcount > 0
If Rsquery ("DocTitle") <> "" Then
Response.Write "<p><b><a href=" "& Rsquery (" Vpath ") &" > "& Rsquery (" DocTitle ") &" & Lt;/a></b><br> "
Response.Write "<font size=-1>" & Rsquery ("Characterization") & "...</font><br>"
Response.Write "<font size=-2>" & Rsquery ("Hitcount") & "Hit (s) </font></p>"
End If
RowCount = Rowcount-1
Rsquery.movenext
Wend
Response.Write "<br><Br>"
%>


<%
Else
%>

<p>
Sorry, no record found, if you want to query more than two words, use and OR.
</p>

<%
End If
%>

</body>


The first thing you need to do is establish a reference to the Index server object. This is done by using the Server.creatobject method:


Set objquery = Server.CreateObject ("Ixsso. Query ")



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.