Wednesday, June 6, 2007

Create Custom Search Page in SharePoint Server

1) To start full crawl navigate to following path:
Shared Service Administration: SharedServices1 => Search Settings => Content sources and crawl schedules => Full Crawl

2) To create a new scope navigate to following path:
Shared Service Administration: SharedServices1 => Search Settings => View Scopes => New Scope => “MSDN Content” (New defined scope)

Enter following information in the page:
a) Title and Description: MSDN Content
Target Results Page: Specify a different page for searching this scope
Target results page: * => msdnsearch.aspx

b) Scope Rule Type: All Content

3) To add Tab in Search page navigate to Search tab in Home page.
By default Search Centre has two Tabs -- All Sites and People.

To create a search page navigate to following path --
Home => Search tab => Site Actions => Create Page

Enter following information in the page:
a) Title: MSDN Search
b) Page Layout: (Welcome Page) Search Page
c) Press Button Create.
d) Publish page.

To create a search results page navigate to following path --
Home => Search tab => Site Actions => Create Page

Enter following information in the page:
a) Title: MSDN Search Results
b) Page Layout: (Welcome Page) Search Results Page
c) Press Button Create.
d) Publish page.


4) To set the search and search results page for new tab perform following actions:

Navigate to following path:
Home => Search => Tabs in Search Pages => Sites Actions => View All Sites Contents => Lists => Tabs in Search Pages => New => New Item

Enter following information in page:
a) Tab Name: MSDN
b) Page: msdnsearch.aspx
c) Press OK


Navigate to following path:
Home => Search => Tabs in Search Results => Sites Actions => View All Sites Contents => Lists => Tabs in Search Results => New => New Item

Enter following information in page:
a) Tab Name: MSDN
b) Page: msdnsearch.aspx
c) Press OK

5) Now if you go to following path:
Home => Search => MSDN tab

Write some search keyword in Search text and start the search, the search results will be displayed in All Sites tab.

So, to display the search results in the newly created search results page (i.e. msdnsearchresults.aspx) perform following actions:

Navigate to following path:
Site Actions => Site Settings => Modify All site Settings => Site Collection Administration => Go to top level site settings => Site Collection Administration => Search Scopes => New Display Group

Enter following information in page:
a) Title: MSDN
b) Check only: MSDN Content
c) Press OK


Navigate to following path:
Home => Search => MSDN tab => Site Actions => Edit Page => Search Box => Edit => Modify Shared Web Part => Search Box

Set following settings in it:
a) Scopes Dropdown => Show, don not include contextual scope
b) Miscellaneous => Target search results page URL => “msdnsearchresults.aspx” (newly created search result page)
c) Miscellaneous => Scope Display Group => MSDN
d) Press OK
e) Publish page

6) Now the newly created search tab is ready for use.


Search Page with new tab:


Search Result page:



Suggested Links:

1) Creating a Custom Search Page and Tabs in the Search Center of SharePoint Server
http://msdn2.microsoft.com/en-us/library/bb428855.aspx

9 comments:

Ashish Kanoongo said...

Hello

Where is the results.xml?

Seccondly on following lines, something is missing, please see ??? with my questions?
**********
Open Aspx page => Data View => Select - Managed Data Sources => Add an XML File => Browse to file => Press OK

results.xml file => Show Data => Result => Nodes => Select Title, author, write, imageURL => Drag-n-drop in designer
??? in which zone where we need drag-drop???

6) After drag-n-drop of nodes, following sections gets open

???? which section will open
**********

By the way I have various small projects on sharepoint for development with good development cost? if you are interested let me know.

Ashish

Avinash said...

Hi Ashish,

Your question basically belong to following post
Change the search results display in SharePoint Search...

http://avinashkt.blogspot.com/2007/06/change-search-results-display-in.html

I have modified the above mentioned post little bit to answer your questions:

1)Where is the results.xml?
Ans: Please refer the second point again. (Modified one).

2)In which zone where we need drag-drop???
Ans: You can drag-n-drop it to any webpart-zone. Please check image given in point 5. Also check the following link: http://bp0.blogger.com/_sxeNPpEw5xg/RmjfXPuqYnI/AAAAAAAAAHI/ejRq5rC4Wmw/s1600-h/4.jpg

3) Which section will open?
Ans: Please refer the sixth point again. (Modified one).

If you have any further doubt or queries, then please feel free to post it here.

Ashish Kanoongo said...

Hello

I implemented the search result page successfully. I have implemented on infopath document livrary and its search fields.

I noticed it is showing infopath form url rather than dispform.aspx?id=???

How can I change the document url?

N L V said...

Hello,

I've a similar requirement. My site hierarchy is as follows -

Site Collection
Page1
Page2
Page3
Site B
Page1
SiteC
SiteD
SiteE
Page1
Page2
Page3
SiteF
Page1
SiteG
Page1
Page2
Page3

I want two search scopes, one for the Site F alone and the other for the rest of the sites. I want to create two pages for two different scopes. I dont want to create the pages in the search center. Can't i create my custom webpart page and add search core results in the page and redirect the search to that page? How to do that?

Thanks

N L V said...

In my comment the hierarchy of the site is not clear. Here is the link to my post in MSDN.

http://social.technet.microsoft.com/Forums/en/sharepointsearch/thread/a4cb092c-8428-45a8-85cc-3aeb178aea30

Thank you.

Avinash said...

Hi NLV,

Instead of creating pages in search center... you can create a sub-site under your required site.

Steps-
1. Create a sub-site by choosing search template.
2. Go to your main parent site.
3. Go to Site Actions > Site Settings > Search Settings
4. Change the search center path, so that it refers to your newly created search sub-site.

Regarding scope--
1. Create your scope in Central Administration.
Central Administration > Share Services > Search Scope [check exact navigation path]

2. Add newly created scope in your SharePoint site [thats contains your development and search site]
Site Actions > Site Settings > Search Scope

You have to explore little bit on custom search scope.... I never personally worked in that deep :(



Regarding custom page with Search WebPart-
1. Open any existing search center page in SharePoint Designer
2. Then check the Search WebPart name and its reference OR try to add search related web part through Add Web Part dialog box.

Personally I would recommend that instead of creating a separate search page... you should create a separate search center as sub-site.

Please let me know if you still have some query....

N L V said...

Thanks for your prompt reply. It helped a lot.

Regards
NLV

Vaibhav said...

My requirnment:
"Showing the total number of search results based on the submitted keyword or query so that you can show some statistics like Results 1-10 of 572"

How to get the total count of the searched items?

Avinash said...

Hi Vaibhav,

I think you are looking for this....

"The Search Statistics Web Part

The Search Statistics Web Part displays statistics such as the number of results shown on the page, the total amount of results, and the time it took to execute the search query. There’s nothing really exciting to configure other than the option of displaying the text on one line or two and another option for hiding or displaying individual items."

Reference- http://msdn.microsoft.com/en-us/library/bb608302(office.12).aspx

Google