Solved

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

Posted on 2011-02-22
16
2,271 Views
1 Endorsement
Last Modified: 2012-05-11
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
Comment
Question by:skinsfan99
  • 5
  • 4
  • 2
  • +1
16 Comments
 
LVL 6

Expert Comment

by:MuffyBunny
ID: 34954475
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
 

Author Comment

by:skinsfan99
ID: 34954788
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
 
LVL 6

Expert Comment

by:MuffyBunny
ID: 34954797
Ah ok.. no I wasn't doing anything with Indexing Service.
0
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

Author Comment

by:skinsfan99
ID: 34988902
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
 
LVL 30

Accepted Solution

by:
Brad Howe earned 500 total points
ID: 35070148
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
 
LVL 30

Assisted Solution

by:Brad Howe
Brad Howe earned 500 total points
ID: 35070247
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
 

Author Comment

by:skinsfan99
ID: 35088854
@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
 
LVL 30

Expert Comment

by:Brad Howe
ID: 35088977
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
 

Author Comment

by:skinsfan99
ID: 35129536
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
 
LVL 30

Expert Comment

by:Brad Howe
ID: 35360284
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
 
LVL 69

Expert Comment

by:Qlemo
ID: 35446316
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 

Author Comment

by:skinsfan99
ID: 35829303
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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Run a Radio Station (Streaming media) with web interface 10 51
Unexpected End of File 11 56
FTP welcome message 7 39
Validating Date 4 28
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question