• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2449
  • Last Modified:

Server 2008 - Indexing Service - Custom Search Page With Classic ASP

We have a website built with Classic ASP. The site has a custom search page that accesses the indexing service catalog.  The customer recently moved the site to Server 2008.  Now the search page no longer works.  It returns results with the appropriate web page but the path to the file is always the root of the website.  For example, the website is http://website.com/.  In the search results this is always the path to the web page found.  

I have done some research on Microsoft’s website.  They do indicate changes have been made and I see the following statement:  

“You cannot index Internet Information Services (IIS) Web sites in Windows Server 2008 because of the design changes that were made to IIS 7.0. The catalog that you use for the Indexing Service still has the Tracking tab. However, the catalog does not save any changes that you make to the WWW Server setting.”

Has anyone run into this issue?  Is there a way to get my search page working again?
1
skinsfan99
Asked:
skinsfan99
  • 5
  • 4
  • 2
  • +1
2 Solutions
 
MuffyBunnyCommented:
I think I'm on the same page as you. I had to write a classic ASP script that outputs the names of all of the directories in a subdirectory. I had to refer to the outermost directory with full path info because IIS forced the assumption of my "root" being my Inetpub directory.

So in my circumstance, I had to use dname="K:\whatever". Relative paths wont work correctly unless all your target docs happen to be under your Inetpub.
0
 
skinsfan99Author Commented:
Were you running a query against the catalog created in the Indexing Service?  That is the issue I am having in that the query no longer returns the path to the files.  I know it is related to the Server 2008 changes to the Indexing Service but am unclear on if there is a resolution.
0
 
MuffyBunnyCommented:
Ah ok.. no I wasn't doing anything with Indexing Service.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
skinsfan99Author Commented:
Thank you.  Hopefully someone can point me in the right direction, but so far nothing.  I have to beleive there is someone on this site with server 2008 and indexing service knowledge.
0
 
Brad HoweCommented:
Hi,

This is a feature that requires the IIS management Compatibility kit PLUS a adsiutil execution.

Install IIS 6 Management Compatibility

1. Click Start , point to All Programs , point to Administrative Tools , and then click Server Manager .
2. In the console tree of Server Manager, Expand Roles , and then right click Web Server(IIS). Click Add Role Services
3. In the Add Role Services Wizard, select IIS 6 Management Compatibility, and then click Next .
4. Follow the instructions in the Add Role Services Wizard to complete the installation.

Open Index ServicesSelect the web site you want to search

1. In Indexing MMC right click your catalog and choose Properties.
2. Click Tracking tab.
3. Select the web site you want to index in “WWW Server” dropdown list.
4. Then click OK.
5. To verify whether you select the web site, please check the following values under the registry:
        HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ContentIndex\Catalogs\[Catalog Name]
            IsIndexingW3Svc  - Should be set to "1"
            W3SvcInstance    - Should be set to the website ID.
 
Set ContentIndexed metabase property

1. Open a command prompt and change the current directory to %systemdrive%\inetpub\adminscripts
2. cmd> cscript adsutil.vbs set w3svc/[web site instance]/root/ContentIndexed 1
 
The key is the metabase script. this indexes the site for you and you will see a like world icon and the site in the directory path after running this.

Here is a sample page that formats the VPath and url for you. I modifed it a bit do give you the idea.
Source : http://www.brettb.com/searchingindexserverwithasp.asp

Search Form
<html>
<head> <title>Index Server Example Search Form</title> </head>
<body>

<form method="POST" action="SearchResults.asp" name="frmSearch">
  <p><input type="text" maxlength="255" name="query" size="20" value>
     <input type="submit" value="Search" name="B1"> </p>
</form>
</body>
</html>


Results Page
<html>
<head> <title>Index Server Example Search Results Page</title> </head>

<body>
<%
Dim sSearchString
Dim oQuery

sSearchString = Request.Form("query")

Const SEARCH_CATALOG = "CodeProject" 'remember to change this
%>
<%
Set oQuery = Server.CreateObject("IXSSO.Query")

oQuery.Catalog = SEARCH_CATALOG
oQuery.Query = "@all " & sSearchString & " 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"
oQuery.MaxRecords = 200
oQuery.SortBy = "rank[d]"
oQuery.Columns = "DocAuthor, vpath, doctitle, FileName, Path, Write, Size, Rank, Create, Characterization, DocCategory"
Set oRS = oQuery.CreateRecordSet("nonsequential")
%>
<%
If oRS.EOF Then
Response.Write "No pages were found for the query <i>" & sSearchString & "</i>"
Else
Response.write "<h1>Search Results </h1><br><br>"

Do While Not oRS.EOF

Response.write "<b>FileName:</b> " & oRS("FileName") & "<br>"
Response.write "<b>Path:</b> " & oRS("Path") & "<br>"
Response.write "<b>VPath:</b> " & oRS("vPath") & "<br>"
Response.Write "<b>URL: </b> <a href='http://" & Request.ServerVariables("SERVER_NAME") & oRS("vpath") & "'>http://" & Request.ServerVariables("SERVER_NAME") & oRS("vpath") &" </a><br>"
Response.Write " <hr> <br><br>"
oRS.MoveNext
Loop
End If
%>
<%
Set oRS = nothing
Set oQuery = nothing
%>
</body>
</html>

Let me know if this works for you.
Cheers,
Hades666
0
 
Brad HoweCommented:
Single page code that posts back to itself. A little cleaner in my eyes.

I would still prefer .NET though.


<html>
<head> <title>Index Server Example Search Page</title> </head>
<body>

<form method="Post" action="" name="frmSearch">
  <input type="text" maxlength="255" name="query" size="20"/> 
  <input type="submit" value="Search" name="B1"/>
</form>


<%
Dim sSearchString
Dim oQuery
sSearchString = Request.Form("query")
Const SEARCH_CATALOG = "CodeProject" 'remember to change this
%>

<%
If sSearchString <> "" Then
    Set oQuery = Server.CreateObject("IXSSO.Query")
    oQuery.Catalog = SEARCH_CATALOG
    oQuery.Query = "@all " & sSearchString & " 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"
    oQuery.MaxRecords = 200
    oQuery.SortBy = "rank[d]"
    oQuery.Columns = "DocAuthor, vpath, doctitle, FileName, Path, Write, Size, Rank, Create, Characterization, DocCategory"
    Set oRS = oQuery.CreateRecordSet("nonsequential")

    If oRS.EOF Then
        Response.Write "No pages were found for the query <i>" & sSearchString & "</i>"
    Else
        Response.write "<h1>Search Results </h1><br><br>"
        Do While Not oRS.EOF
            Response.write "<b>FileName:</b> " & oRS("FileName") & "<br>"
            Response.write "<b>Path:</b> " & oRS("Path") & "<br>"
            Response.write "<b>VPath:</b> " & oRS("vPath") & "<br>"
            Response.Write "<b>URL: </b> <a href='http://" & Request.ServerVariables("SERVER_NAME") & oRS("vpath") & "'>http://" & Request.ServerVariables("SERVER_NAME") & oRS("vpath") &" </a><br>"
            Response.Write " <hr> <br><br>"
            oRS.MoveNext
        Loop
    End if
End If
%>

<%
Set oRS = nothing
Set oQuery = nothing
%>
</body>
</html>

Open in new window

0
 
skinsfan99Author Commented:
@hades666 - Before I attempt to implement your solutions I need to confirm if these are solutions for creating the search on Server 2008 using indexing service?  I have search code that has been working for years.  This issue is that it no longer works on Server 2008 and it appears that MS has changed the indexing service.   Please confirm your solutions are for Server 2008.  

Thank you for your time!!
0
 
Brad HoweCommented:
Yes sir.
it is a requirement for 2008. There are very limited changes required that can also be rolled ack.

Install compatibilty kit, execute Cmd  script, modify the code provided to use your current index and test.

Give it a shot and let me know.
Hades666
0
 
skinsfan99Author Commented:
This is not an inactive question.  We are still confirming that the solution provided will work.  Considering it took 15 days to get a response please give us sometime to confirm the offered solution.  Thank you.
0
 
Brad HoweCommented:
Barring other comments, the solution provided is correct with example code. The issue is hte index service is deprecated in 2008 and needs some tweaks to get it to function correctly.

Cheers,
Hades666
0
 
QlemoC++ DeveloperCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 
skinsfan99Author Commented:
Sorry for not getting back and closing this question.   I was unavailable for the last month or so

The solution did infact work and the points appear to have been applied correctly.  

Thank you for your assistance.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 5
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now