How to create a custom search results page in MOSS 2007


I have created a subsite in a MOSS 2007 installation, where I need to enable the users with local search functionality, i.e. sub-site content search only (docs, lists, pages, etc).

I need to create a page where to place a Search Box web part so as the users will type a query and the search will return results ONLY from the contents of the subsite (document libraries, lists, pages, etc), i.e. I do NOT want to get search results from the parent site or anywhere else BUT the current site.

I would like to be able to present the results of the search on the same page (if possible) using the functionality of the Search Paging web part, along with statistics provided by the Search Statistics and Search Summary web parts.

So far, I have managed to edit the Search Box web part, and selected "Contextual Scope" which seems to restrict results based on the current site, which is what I want. To be honest, I do not know whether this is the "correct" setting per se that I am looking for.

Also, I would like to hide the combobox on the left of the search box web part (the scope combo), since the users cannot change the search scope anyway, so I don't see why they should see that in the first place.

I have tried to place the Search Core Results web part on the same page with my Search Box web part, but I cannot get the search results shown on this page, since when I click the search icon I always get redirected to a "standard" search results page using a the OSSSearchResults.aspx "search page template" of MOSS.

I would appreciate a complete solution if anyone could help...

Thank you all for your time.
Who is Participating?
devshedConnect With a Mentor Author Commented:
I have tried placing the search results page on my page where the search query web part resides, but no matter what I tried, I cannot seem to make it present the search results on the same page.

I need to have my page presenting the user with BOTH the search query web part and the search results web part. I have managed to only have the "This site:" search scope selection on the search scopes selection combobox, although I would not mind if I could hide this altogether. However, my main issue is how to place search result web part on my page.

So far, no success.
Ted BouskillSenior Software DeveloperCommented:
You can change the behavior of the search web part to use a specific default scope and hide the other scopes.  That would do what you need.
devshedAuthor Commented:
Like I said above, I have sort of managed to display results based on the contents of my site, but I need a way to present search results on the same page and not the default search results page of MOSS.

The problem is that i cannot return easily back to my page, so I guess it will be difficult for my users to be able to return back to the search page after following some search result.

I need some guidance on how to achieve what I outline above, so please provide any feedback you have on that direction.

Thank you for your time.
Ted BouskillSenior Software DeveloperCommented:
OK, all of the default web search parts on any master page/layout for a site template can be hidden.

I'm assuming you aren't happy with the 'This Site:' option on the default search which would do what you need.

In fact, we had the opposite problem, we didn't want to go to the site collection search results and instead wanted ALL searchs to go back to our main search page.

Have you tried adding the search results web part to your page?  I'm not sure it will work but it's worth a try.  Generally the search results page is a special page.  If you look closely at the default search site there is two primary pages.  The main search page and the search results page.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.