How to realize a search engine using the windows file indexing service. The component used is ixsso.query
It is possible to exclude folders, files or extensions
<%
Set objQuery = Server.CreateObject("ixsso.query")
Set objUtil = Server.CreateObject("ixsso.util")
my_keyword=request("keyword")
' Folder esclusions
myquery=myquery & " and not #path = *\inetpub\iissamples\* "
myquery=myquery & " and not #path = *\winnt\help\iishelp\* "
myquery=myquery & " and not #path = *\winnt\system32\inetsrv\iisadmin\* "
' File esclusions
myquery=myquery & " and not #filename indexmaster.asp"
myquery=myquery & " and not #filename index.asp"
myquery=myquery & " and not #filename indexold.asp"
' Extension esclusions
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>More than 50 results found<hr></b>"
else
Response.write "<b>" & i & " Found<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>New search...</a>"
else%> <a href="search.asp">No douments found</a> <%end if%>