SharePoint 2010 Search – Creating a Search Centre

Standard

We are going to walk through the process of creating a simple ‘Search Centre’ site. This process will including the following steps: –

 Configuration of the Site Collection and Site features

  1. Creation of a task list as a data source
  2. Creation of a Search Centre sub site
  3. Addition of a custom search tab and some custom pages to the Search Centre sub site
  4. Creation of a new Scope and rule
  5. Crawling the content of our data source
  6. Update of our new scope
  7. Applying the scope to our custom page to filter the content returned

 

1) Configure Site Collection features

Go to Site Actions -> Site Collection Administration -> Site Collection Features and ensure the following features are activated.

  • SharePoint Server Enterprise Site Collection features
  • Enable SharePoint Server Publishing Infrastructure
  • Enable SharePoint Server Standard Site Collection features
    .NET Framework 3.5 Error - Control Panel - 002

2) Configure Site features

Go to Site Actions -> Site Settings -> Manager Features, and ensure the following features are activated.

  • SharePoint Server Enterprise Site features
  • Enable SharePoint Server Publishing
  • Enable SharePoint Server Standard Site features
    161

3) Create a data source for our custom search

For the purpose of this demo, we’re going to create a Task list as our data source and populate it with some sample data, which in this case will relate to the tasks in a PRINCE2 project. Go to Site Actions -> More Actions, and create a new task list called ‘Project Tasks’, add a text column for Stage, then switch to Datasheet View and enter some data as follows :

162

– 4) Create a ‘Search Centre’ sub site

Now let’s create a Search Centre sub site, add a couple of custom pages, a custom search tab, and configure the new tab to use the ‘ImportantTasks.aspx’ search page, and ‘ImportantTasksResults.aspx’ as the results page.

  • Go to Site Actions -> New Site
  • Switch to the Search Tab, and create a new ‘Enterprise Search Center’ called ‘Search Centre’, with the URL ‘searchCentre’
  • Go to Site Actions -> View All Site Content -> Pages Library, select the Documents tab from the ribbon
  • Create a new document (page) with the tile ‘Important Tasks’, the URL ‘ImportantTasks.aspx’, and using layout ‘(Welcome Page) Search Box’.
  • Create a new document (page) with the tile ‘Important Tasks Results’, the URL ‘ImportantTasksResults.aspx’, and using layout ‘(Page) SearchResults.aspx’.

You should now have the following: –
162

  • Go to Site Actions -> View All Site Content -> Lists -> Tabs in Search Pages
  • Create a new item called ‘Important Tasks’ that points to the custom search page, ‘ImportantTasks.aspx’ that we created in Step 3
  • Go back to the search centre, where our search page should now include the new ‘Important Tasks’ search tab
  • Click on the ‘Important Tasks’ tab, then edit the page and modify the web part than contains the search box, by setting the value for the ‘Target search results URL’ (located under miscellaneous), to our custom search results page: ‘ImportantTasksResults.aspx’, then select OK to save the changes, and check the page in.164

5) Create a new Scope, and rule

Create a new Scope to contain a set of search results and point users to our custom search results page, and limit the content available on that page.

  • Open Central Administration
  • Go to Manage Service Applications -> Search Service Application
  • Go to Scopes -> New Scope -> Create New Scope
  • Call the scope ‘Important Tasks’ and set the Target Results Page to ‘ImportantTasksResults.aspx’, then save the scope
  • Click on the scope, and add a new rule of type ‘Web Address’ with the folder set to the path of the ‘ProjectTasks’ list which we’re using as our datasource for this demo. This rule ensures that only content in this location will be included in this Scope.
    165

6) Crawl our data source

Start a crawl, so our content can be indexed, and update the scope.

  • Go to Manage Service Applications -> Search Service Application
  • Go to Crawling -> Content Sources
  • Select Local SharePoint Sites -> Start Full Crawl
  • Once the crawl has completed, go to Search Administration and check the ‘Scopes needing update’ property under ‘System Status’. There should be a value of 1, so click on the link to ‘Start update now’ and wait for the update and propagation to complete.
  • If you go now back to Scopes, the ‘Important Tasks’ scope should have some items and an update status of Ready.
    166

7) Review our progress and apply Scope to search

The last step is to return to the Seach Centre, perform a search to review our current progress, and then update the search results page so that it uses the new Scope, and limits the results returned to items in our data source.

  • Go back to our search centre, refresh the search page, and switch to the ‘Important Tasks’ tab, so that we are using the ‘ImportantTasks.aspx’ page.
  • Enter in a search query (in my case ‘Appoint’), but you can use anything that should return some data, then click search
  • Now that we have the custom results page (ImportantTasksResults), Edit the page, locate the ‘Search Core Results’ web part and under the ‘Location’ category, set the Location to ‘Local Results Only’, and the Scope to ‘Important Tasks’, to apply our scope to the results, then click OK, and check the page in.
  • Refresh the search centre, select the tab: ‘Important Tasks’ as before and click search…… this time we should see only the data we expect to see….which is the items from our task list.
    167
  • And if we click on an item, we see the actual item from the task list.
    168

There are plenty more things we can do when creating search application in SharePoint 2010, such as enhancing the user interface, creating new web parts that interact with the search web parts, changing results rendering, creating custom ranking models and many more, but hopefully this has shown you how easy it can be to get started.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s