I inherited some ancient code as part of redesigning a client's website. It is supposed to contact the indexing service on the local machine to search through files in the webroot and return results.
when i initially looked at indexing service, it was not even running, having been disabled at some point in the past, but the websearch had still been returning results - presumably cached from when the service had run previously. after starting the service, creating a new catalog with the same name that was referenced in the code, letting the index populate, and re-running the search on the site, it still returned the exact same results. when i run a search through the index service directly, the results are wildly different than what the page displays.
it doesn't seem to be querying the new catalog i have created. the names match up, but as i am not familiar with any of this i could be missing something obvious.
---------------------------------------------------------------------
'Get results from each of the catalogs. We'll append them on to an array.
dim vResults
set vResults = server.CreateObject("Scripting.Dictionary")
'Call GetResults for each catalog
GetResultsSite vResults,"CATALOGNAME",sSearchText
-----snip... stuff that displayed the results went here-----
sub GetResultsSite(vResultsDict, sCatalog, sQuery)
on error goto 0
dim oQuery
set oQuery = Server.CreateObject("MSSearch.Query")
'Set query parameters
oQuery.Catalog = "query://localhost/" & sCatalog
oQuery.MaxRecords = 5000
oQuery.Query = sQuery
oQuery.Columns = "DocTitle, Description, Rank, vpath"
oQuery.AllowEnumeration = true
' Create the recordset holding the search results.
'on error resume next
set RS = oQuery.CreateRecordSet("sequential")
----------snip the rest of the function that dealt with excluding the admin directory and error handling------
when i initially looked at indexing service, it was not even running, having been disabled at some point in the past, but the websearch had still been returning results - presumably cached from when the service had run previously. after starting the service, creating a new catalog with the same name that was referenced in the code, letting the index populate, and re-running the search on the site, it still returned the exact same results. when i run a search through the index service directly, the results are wildly different than what the page displays.
it doesn't seem to be querying the new catalog i have created. the names match up, but as i am not familiar with any of this i could be missing something obvious.
---------------------------------------------------------------------
'Get results from each of the catalogs. We'll append them on to an array.
dim vResults
set vResults = server.CreateObject("Scripting.Dictionary")
'Call GetResults for each catalog
GetResultsSite vResults,"CATALOGNAME",sSearchText
-----snip... stuff that displayed the results went here-----
sub GetResultsSite(vResultsDict, sCatalog, sQuery)
on error goto 0
dim oQuery
set oQuery = Server.CreateObject("MSSearch.Query")
'Set query parameters
oQuery.Catalog = "query://localhost/" & sCatalog
oQuery.MaxRecords = 5000
oQuery.Query = sQuery
oQuery.Columns = "DocTitle, Description, Rank, vpath"
oQuery.AllowEnumeration = true
' Create the recordset holding the search results.
'on error resume next
set RS = oQuery.CreateRecordSet("sequential")
----------snip the rest of the function that dealt with excluding the admin directory and error handling------