<%
Dim strQuer ' The text of our query
Dim strQuery ' The text of our query + info
Dim strQuert
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
strQuer =""
strQuer = Request.QueryString("query")
' Response.Write("Form "+ Request.Form("query"))
' Response.Write("String "+ Request.QueryString("query"))
strQuery = SuAnd(strQuer)
' 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-Baltu" ' Catalog to query
.MaxRecords = 256 ' Max # of records to return
.SortBy = "rank [d]"
.Columns = "filename, path, vpath, size, write, " _
& "characterization, DocTitle, DocAuthor, " _
& "DocKeywords, rank, hitcount"
' Build our Query: Hide admin page and FPSE pages
strQuery = "(" & strQuery & ")" _
& " AND NOT #filename = *admin*" _
& " AND NOT #path *\_vti_*"
' Uncomment to only look for files modified last 5 days
'strQuery = strQuery & " AND @write > -5d"
.Query = strQuery ' Query text
End With
' To set more complex scopes we use the utility object.
' You can call AddScopeToQuery as many times as you need to.
' Shallow includes just files in that folder. Deep includes
' subfolders as well.
'
'Dim objUtility
'Set objUtility = Server.CreateObject("IXSSO.Util")
'objUtility.AddScopeToQuery objQuery, "c:\inetpub\wwwroot\indexserver", "shallow"
'objUtility.AddScopeToQuery objQuery, "c:\inetpub\wwwroot\indexserver\content", "shallow"
'Set objUtility = Nothing
' Get a recordset of our results back from Index Server
Set rstResults = objQuery.CreateRecordset("nonsequential")
' Get rid of our Query object
Set objQuery = Nothing
Response.Write " "
Response.Write "Ieškota: "
Response.Write strQuer
' Check for no records
If rstResults.EOF Then
Response.Write " Deja, rezultatų nėra..."
Else
' Print out # of results
Response.Write "; Rasta ("
Response.Write rstResults.RecordCount
Response.Write "): "
' Loop through results
%><%
Do While Not rstResults.EOF
' Loop through Fields
' Pretty is as pretty does... good enough:
%>
<% If rstResults.Fields("doctitle") = "" Then %>
"><%= PathToVpath(rstResults.Fields("path")) %>
<% Else %>
"><%= rstResults.Fields("doctitle") %>
<% End If %>
<%= rstResults.Fields("characterization") %>
<%
' Move to next result
rstResults.MoveNext
Loop
rstResults.MoveFirst
Response.Write ""
'Response.Write rstResults.GetString()
Response.Write " "
End If
' Kill our recordset object
Set rstResults = Nothing
End If
%>
<%
Function PathToVpath(strPath)
Const strCompRoot = "e:\intepub\wwwroot\draugai\muziejai\baltu\"
Const strWebRoot = "http:\\www.baltu.lt\"
Dim strTemp, strTempm, strTempn
strTemp = strPath
strTempm = Replace(strTemp, strCompRoot,strWebRoot)
strTempn = Replace(strTempm, "\", "/")
PathToVpath = strTempm
End Function
%>
|