Ik heb een Intranet draaien op Windows 2003 maar wil de indexservice van een andere Windows 2003 server gebruiken. De gerbuiker die dat oproept moet dat onder zijn eigen accountsnaam doen, ivm rechten op mappen etc ter voorkoming dat de verkeerde info wordt opgehaald. Ik heb een script dat heel goed werkt, alleen op de Intranet Windows 2003 server:
<%@ Language="VBScript" %>
<% Option Explicit %>
<html>
<head>
<title>Basis Zoekpagina</title>
<meta name="description" content="Basis Zoekpagina">
<meta name="keywords" content="Basis Zoekpagina">
<meta name="author" content="admin">
</head>
<body>
<p>
Intranet basis Zoekserver.
</p>
<form action="default.asp" method="get">
<input type="text" name="query" />
<input type="submit" value="Zoeken" />
</form>
<p>
<a href="advanced.asp">geavanceerd Zoeken</a>
</p>
<p>
Queries that should return results include:
<a href="?query=admin">admin</a> (only in basic),
<a href="?query=asp">asp</a> (> 10),
<a href="?query=component">component</a>,
<a href="?query=cookie">cookie</a>,
<a href="?query=database">database</a>,
<a href="?query=date">date</a>,
<a href="?query=time">time</a>,
<a href="?query=email">email</a>,
<a href="?query=form">form</a>,
<a href="?query=search">search</a>,
etc.
</p>
<%
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
' 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 "<p><strong>"
Response.Write rstResults.RecordCount
Response.Write "</strong> results found:</p>"
' 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 "<strong>"
Response.Write objField.Name
Response.Write ":</strong> "
Response.Write rstResults.Fields(objField.Name)
Response.Write "<br />"
Next
' Spacing between results
Response.Write "<br />"
' Move to next result
rstResults.MoveNext
Loop
End If
' Kill our recordset object
Set rstResults = Nothing
End If
%>
</body>
</html>
Middels dit script wil ik de gebruikers de mogelijkheid geven om via intranet zeer snel documenten op de fileserver te laten zoeken.
Iemand een idee?
<%@ Language="VBScript" %>
<% Option Explicit %>
<html>
<head>
<title>Basis Zoekpagina</title>
<meta name="description" content="Basis Zoekpagina">
<meta name="keywords" content="Basis Zoekpagina">
<meta name="author" content="admin">
</head>
<body>
<p>
Intranet basis Zoekserver.
</p>
<form action="default.asp" method="get">
<input type="text" name="query" />
<input type="submit" value="Zoeken" />
</form>
<p>
<a href="advanced.asp">geavanceerd Zoeken</a>
</p>
<p>
Queries that should return results include:
<a href="?query=admin">admin</a> (only in basic),
<a href="?query=asp">asp</a> (> 10),
<a href="?query=component">component</a>,
<a href="?query=cookie">cookie</a>,
<a href="?query=database">database</a>,
<a href="?query=date">date</a>,
<a href="?query=time">time</a>,
<a href="?query=email">email</a>,
<a href="?query=form">form</a>,
<a href="?query=search">search</a>,
etc.
</p>
<%
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
' 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 "<p><strong>"
Response.Write rstResults.RecordCount
Response.Write "</strong> results found:</p>"
' 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 "<strong>"
Response.Write objField.Name
Response.Write ":</strong> "
Response.Write rstResults.Fields(objField.Name)
Response.Write "<br />"
Next
' Spacing between results
Response.Write "<br />"
' Move to next result
rstResults.MoveNext
Loop
End If
' Kill our recordset object
Set rstResults = Nothing
End If
%>
</body>
</html>
Middels dit script wil ik de gebruikers de mogelijkheid geven om via intranet zeer snel documenten op de fileserver te laten zoeken.
Iemand een idee?