As a developer, I normally wouldn’t blog about non-development topics, but I find myself recently performing configuration tasks in relation to the development projects I am responsible for. With this in mind, I’ve decided to write an article on configuring basic search functionality in SharePoint 2010, in the hopes that others will find it useful in quickly running through a series of steps to get search up and running in a SharePoint 2010 environment.
I am assuming that your environment is a SharePoint 2010 Standard (or Enterprise) installation, as Search is included in these versions. If you are running SharePoint Foundation, you will need to install Search Server Express first. I am also assuming that you have administrative access to your environment.
In order for your SharePoint site to be searchable, you must first create and configure a Search Service application. To do so, follow these steps:
- Open Central Administration, and click on the Manage Service Applications link, under Application Management:
- Click on the New icon in the ribbon (under the Create section), and select Search Service Application:
- The following dialog will appear, with entry fields to enter information needed to create the new Search Service Application. Enter a Service Application Name, and select ‘None’ under FAST Service Application. For the Search Service Account, you can create a managed account to associate with the Search Service Application (I kept the default Network Service account selection, for simplicity).
- You will then need to create a new application pool for the Search Admin Web Service. You can select an existing application pool by selecting one from the dropdown list, under the Use existing application pool selection. To create a new application pool, select the Create new application pool selection, and enter an appropriate name for your application pool. For the application pool security account, you can use a predefined account (I used the default Network Service account), or you can create a new managed account if you wish to have greater control over the service account.
- You will also need to create an application pool for the Search Query and Site Settings Web Service. You can select an existing application pool by selecting one from the dropdown list, under the Use existing application pool selection. To create a new application pool, select the Create new application pool selection, and enter an appropriate name for your application pool. For the application pool security account, you can use a predefined account (I used the default Network Service account), or you can create a new managed account if you wish to have greater control over the service account. Press the OK button when you are ready to create the new search service application.
- A dialog will appear when the system has successfully created the new search service application. Press OK to close this dialog.
- Returning to Central Administration, you should now see two (2) new service applications.
- The next step is to verify that the user(s) you selected as service accounts have the proper permissions for Search. Scroll down the list of service applications to find the User Profile Service Application and click on the whitespace next to it (so the ribbon changes). Click on the Administrators button in the ribbon, under the Operations section.
- A dialog will appear, with a listing of all the administrator accounts. Find the account(s) you specified for the service accounts (when configuring the search service application), and verify that the Retrieve People Data for Search Crawler checkbox is checked. In this example, the NT AUTHORITYNETWORK SERVICE account was used as the service accounts, so that is the only account I need to verify. Press OK when you are finished.
- The next step is to verify that the service account(s) you selected as service accounts have read access to your SharePoint site. Go back to Central Administration, and under Application Management, click the Manage Web Applications link.
- Click on whitespace next to the SharePoint – 80 web application and select the User Policy button in the ribbon (under the Policy section).
- A dialog will appear. Verify your service account(s) have Full Read permissions. In this example, the NT AUTHORITYNETWORK SERVICE account was used as the service accounts, so that is the only account I need to verify. Press OK when finished.
Now that the service application is properly configured, the next step is to setup the search crawl, so content is included when a user performs a search.
- Open Central Administration and click your search service application (under Application Management à Manage Service Applications).
- You are now taken to the main area where you can specify all the configuration information for search in SharePoint 2010, including content sources, search crawls, search scopes, and crawl rules.
- In order to setup a search crawl for a SharePoint site, click on the Content Sources link, under the Crawling section (on the left hand side of the page). This page will display the content sources for the search (Local SharePoint Sites is created by default). Right mouse click on Local SharePoint Sites to display the context menu, and select Edit.
- The Edit Content Source page is displayed, and this is where you configure the content source. You are able to specify what URLs the content source will look through when crawling (under the Start Addresses section). You can also setup a crawl schedule for the content source, specify priority for the content source, as well as kick off a full crawl when you press the OK button.
Search scopes define specific areas that users can search in, when performing searches from SharePoint. This gives you the flexibility to limit search results to specific content areas in your SharePoint environment.
Here are the following steps to configure a search scope. I am using a scope called Data Forms as an example, so you can repeat these steps for whatever search scope you wish to configure.
- Create a content source that corresponds to the search scope you are configuring.
- When you create the new content source, make sure you add the subsite location (or folder) in the Start Addresses that correspond to the area you want the search scope to crawl content for. Also select Custom – specify page depth and server hops options under Crawl Settings, with an unlimited page depth, so the crawler crawls all content under the start address you specify. Depending on how your content is structured, you may find it more appropriate to select one of the other crawl settings options. Press OK when finished.
- You need to create a crawl rule to include the address that corresponds to your search scope, so the crawler knows to include the content. Click on Manage Crawl Rule, under the Crawling section (on the left hand side links) to navigate to the page to create crawl rules.
- Click on New Crawl Rule, and enter the appropriate URL in the Path entry area. Select Include all items in this path, under the Crawl Configuration area. Selecting Exclude all items in this path will exclude the content in this rule. The three checkboxes are not necessary, unless you have specific data that has special crawling considerations. Press OK when finished.
- The next step is to create the actual search scope. Click on the Scopes link under Queries and Results section (in the left hand links area). This will display a page that lists all the search scopes in the system.
- Clicking on New Scope will display a page that allows you to create a new search scope. Give the new search scope a title. You can leave the Target Results Page selection to the default results page (unless you have a custom search results page created). Click OK when finished.
- You now need to add a couple of rules to the search scope, so right mouse click the newly-created search scope, and select Edit Properties and Rules.
- The Scope Properties and Rules page will display. This screen allows you to create rules that determine what content is included or excluded for this search scope.
- Click on New Rule to create another new rule for this search scope. For our rule, we are including all the content from the appropriate URL that corresponds to the subsite for the search scope. Select Web Address from the Scope Rule Type section, and select the Folder option from the Web Address section, and enter the appropriate URL. Under the Behavior section, select the Include option. Press OK when finished.
- As a last step, make sure you run full crawls on the entire site. This should update the crawled content, and you should be able to perform searches in your SharePoint environment.
I have detailed out the steps to configure basic search capability in SharePoint 2010. Please note that there are a number of options in the configuration that I did not describe in detail, as I have not done a full deep-dive into all the options at the time of writing this article. My intention is to create a checklist to get search configured quickly, so if you have information on how specific options affect search, I would love to hear about them.