Welcome to WebmasterWorld Guest from 3.227.3.146

Forum Moderators: ocean10000

Message Too Old, No Replies

ASP Intranet Search - need to exclude certain file types

Help with my ASP Intranet Search

     
11:34 am on May 28, 2008 (gmt 0)

New User

10+ Year Member

joined:May 28, 2008
posts:4
votes: 0


I am adding a search box to my company intranet so that users can search for forms etc with ease.

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.

4:07 am on June 1, 2008 (gmt 0)

Administrator

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month

joined:Jan 14, 2004
posts:864
votes: 3


Background:
Just to give some people some background information. The user is using Microsoft Index Server. This software is designed to provide free form text search for files which are accessible via that server. And has been shipped with Microsoft Servers since IIS 2.0 I believe.

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"
12:01 pm on June 2, 2008 (gmt 0)

New User

10+ Year Member

joined:May 28, 2008
posts:4
votes: 0


Thanks alot, that worked perfectly.

Thank you for your help.

6:57 pm on Aug 1, 2008 (gmt 0)

New User

10+ Year Member

joined:Aug 1, 2008
posts: 1
votes: 0

Would you tell how you modify / setup the Index Service to see all folder names and file names.

I want to use the Index Service instead of an FSO.

I have around 6000 folders in a sub directory.

I'm searching for a specify folder name.

Thanks in advance.

4:40 pm on Aug 10, 2008 (gmt 0)

Administrator

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month

joined:Jan 14, 2004
posts:864
votes: 3


Stupid Question why so many sub folders under one Master Folder?

Windows tends to get vary slow reading a directory after about 500 to 1000 sub folders from my experience (usually from a network share). Wouldn't it be better to restructure the folder structure to get the speed back. So the folders would be more of a tree design instead of everything in one huge folder. And FSO objects are a great deal less processor intensive then the Index server objects, especially just looking up directories names.