Forum Moderators: open
With the help of websites I have managed to create a search function and it brings up the correct results.
The only problem is that it is also bringing up the htm, js and css files located in the Intranet folder.
I have searched for a way to exclude certian file types from my search but have found nothing.
Any help would be appreacted.
Here is the code in my results.asp file.
----------------------------------------------------------------
<html>
<head>
<title>
Search Results
</title>
</head>
<body>
<%
' This section sets the various configuration variables
formscope="\"
pagesize = 5000
maxrecords=5000
searchstring=request.form("searchstring")
catalogtosearch="FPSE_SEARCH"
searchrankorder="rank[d]"
origsearch=searchstring
%>
<%
'This section performs the query
dim q
dim util
set q=server.createobject("ixsso.query")
set util=server.createobject("ixsso.util")
q.query=searchstring
q.catalog = "query://FTS01/FPSE_SEARCH"
q.sortby=searchrankorder
q.columns="doctitle, filename, size, write, rank, directory, path"
q.maxrecords=maxrecords
%>
<%
'This section displays the results
set rs=q.createrecordset("nonsequential")
rs.pagesize=pagesize
response.write"<p>Your search for <b>" & origsearch & "</b> produced "
if rs.recordcount=0 then response.write "no results"
if rs.recordcount=1 then response.write "1 result: "
if rs.recordcount>1 then response.write(rs.recordcount) & " results: "
%>
<table border=1><tr><td bgcolor="#99CCFF"><b>Title</b></td><td bgcolor="#99CCFF"><b>Filename</b></td></tr>
<%
do while not rs.EOF
response.write "<tr><td>" & rs("doctitle") & "</td><td>" & "<a href=" & "'" & rs("path") & "'" & " target=blank>" & rs("filename") & "</a>" & "</td></tr>"
rs.movenext
loop
response.write "</table>"
set rs=nothing
set q=nothing
set util=nothing
%>
</body>
</html>
------------------------------------------------------------------
Thanks in advance.
Answer:
I found the following query with some edits for display here that should point you in the proper direction for the change to the query.
q.query = searchstring & " AND NOT #path *_* AND NOT #path *downloads* AND NOT #path *images* AND NOT #filename *.class AND NOT #filename *.asa AND NOT #filename *.css AND NOT #filename *postinfo.html"