MontyTekTips
Programmer
Recently my company took over a number of sites programmed by another company. One of the sites had a site search built with the Micro$oft Index Server. After moving the site to the new location and running some tests on it, I discovered that this search tool would break any time one of the "ignored" noise words was used in a search. The tool would break regardless of whether the noisy word was ANDed or ORed in combination with other valid search terms. In my searching so far, I have discovered only two solutions to this quandy.
1. Edit the "noise" file found in c:\winnt\system32\noise.XXX.
2. Catch errors with "On Error Resume Next" and force users to reenter their search whenever a noise word has been used.
The former (1) is not an option, as I don't wish to alter the way that Index Server words for the entire operating system, and the latter (2), although I am using it for the time being, seems like an ugly kludge. I would think that M$ wouls have given some ability to handle this seemingly common situation. Is there no easy way to override the noise file checking? Another solution I have considered is stripping all noise words from search queries before submitting to the Index Server but this too seems a bit klunky and inefficient.
Below is some relevant code from my page:
SQL Query:
idxSQL = "SELECT DocTitle, vpath, filename, characterization, rank
FROM SCOPE()
WHERE CONTAINS ('the')>0 AND CONTAINS ('test')>0
and path not like '%_private%'
and path not like '%images%'
and path not like '%vti%'
and filename not like '%.asa'
and filename not like '%.js'
order by rank desc, DocTitle asc"
Code:
' Create and open a connection
set idxConn = Server.CreateObject("ADODB.Connection"
idxConn.ConnectionString = "provider=msidxs;data source=d:\tmiweb\wktindex;"
idxConn.Open
' ErrorHandling / Ignored Words
Err.Number = 0
On Error Resume Next
set idxRecSet = idxConn.Execute(idxSQL)
If Err.number <> 0 Then
Response.Write "<P><B>ERROR:</B> Your search phrase included reserved words (and, the, a, etc.). Please remove the reserved words and try again.</P>"
Else
'Display matches
'...
End If
1. Edit the "noise" file found in c:\winnt\system32\noise.XXX.
2. Catch errors with "On Error Resume Next" and force users to reenter their search whenever a noise word has been used.
The former (1) is not an option, as I don't wish to alter the way that Index Server words for the entire operating system, and the latter (2), although I am using it for the time being, seems like an ugly kludge. I would think that M$ wouls have given some ability to handle this seemingly common situation. Is there no easy way to override the noise file checking? Another solution I have considered is stripping all noise words from search queries before submitting to the Index Server but this too seems a bit klunky and inefficient.
Below is some relevant code from my page:
SQL Query:
idxSQL = "SELECT DocTitle, vpath, filename, characterization, rank
FROM SCOPE()
WHERE CONTAINS ('the')>0 AND CONTAINS ('test')>0
and path not like '%_private%'
and path not like '%images%'
and path not like '%vti%'
and filename not like '%.asa'
and filename not like '%.js'
order by rank desc, DocTitle asc"
Code:
' Create and open a connection
set idxConn = Server.CreateObject("ADODB.Connection"
idxConn.ConnectionString = "provider=msidxs;data source=d:\tmiweb\wktindex;"
idxConn.Open
' ErrorHandling / Ignored Words
Err.Number = 0
On Error Resume Next
set idxRecSet = idxConn.Execute(idxSQL)
If Err.number <> 0 Then
Response.Write "<P><B>ERROR:</B> Your search phrase included reserved words (and, the, a, etc.). Please remove the reserved words and try again.</P>"
Else
'Display matches
'...
End If