Il seguente codice si connette ad index server per cercare all'interno del sito tramite il componente ixsso.query
E' possibile escludere una serie di cartelle, di file e di estensioni dalla ricerca
<%
Set objQuery = Server.CreateObject("ixsso.query")
Set objUtil = Server.CreateObject("ixsso.util")
my_keyword=request("keyword")
' Escludo delle cartelle
myquery=myquery & " and not #path = *\inetpub\iissamples\* "
myquery=myquery & " and not #path = *\winnt\help\iishelp\* "
myquery=myquery & " and not #path = *\winnt\system32\inetsrv\iisadmin\* "
' Escludo dei file
myquery=myquery & " and not #filename indexmaster.asp"
myquery=myquery & " and not #filename index.asp"
myquery=myquery & " and not #filename indexold.asp"
' Escludo delle estensioni
myquery=myquery & " and not #filename *.|(inc|,mdb|,cnt|,class|,toc|,css|)"
linebr="<br>" & vbcrlf
Set rstemp = objQuery.CreateRecordSet("nonsequential")
if not rstemp.eof then
dim i
i=rstemp.RecordCount
if i>=50 then
Response.write "<b>Piu' di 50 corrispondenze trovate<hr></b>"
else
Response.write "<b>" & i & " Corrispondenze trovate<hr></b>"
end if
Do Until rstemp.eof
For Each key in rstemp.fields
keyname=lcase(key.name)
Select Case keyname
Case "vpath"
response.write "<b>link: </b></br>"
response.write "<a href='"
response.write key
response.write "'>http://www.morpheusweb.it" & key & "</a>" & linebr
Case"rank"
key=key/10
key=key&"%"
response.write "<b>rank: </b></br>"
response.write key
Case Else
response.write "<b>" & keyname & ":</b>" & linebr
response.write key & linebr
End Select
Next
response.write "<br><hr>"
rstemp.movenext
Loop
rstemp.close
set rstemp=nothing
Set objQuery = nothing
Set objUtil = nothing
response.write "<a href=search.asp>Nuova Ricerca...</a>"
else
%>
<a href="search.asp">Non sono stati trovati documenti</a>
<%
end if
%>