Configuring a search content source

Once a search service application is configured, it needs data for indexing. In this recipe, we will add a new content source for our search service application.

Getting ready

For this recipe, we should have a search service application created in the Provisioning a search service application recipe.

How to do it…

Follow these steps to add a new content source to our search service application:

  1. Navigate to Central Administration in your preferred web browser.
  2. Click on Manage service applications from the Application Management section.
  3. Click on the Search Service Application link we created in the previous recipe.
    How to do it…
  4. In the quick launch, click on Content Sources from the Crawling section as shown in the following screenshot:
    How to do it…
  5. Click on New Content Source.
  6. Provide a name, such as Local SharePoint Sites, for the content source in the Name field.
  7. Select SharePoint Sites for the Content Source Type as shown in the following screenshot:
    How to do it…
  8. Add the URL to the root SharePoint site to index to the Start Addresses section, http://sharepoint/ for instance. Multiple SharePoint sites may be indexed as a single content source. To add more SharePoint sites, add them on a new line in the Start Addresses field.
    How to do it…
  9. Select Crawl Everything Under the Hostname for Each Start Address in the Crawl Settings.

    Tip

    The content source can be configured to index only the site collection that matches the URL provided or to index everything under that URL. For instance, when enabled, http://sharepoint/site will be indexed when http://sharepoint/ is added to the Start Addresses field.

  10. Select Enable Continuous Crawl in the Crawl Schedules.

    Tip

    Continuous Crawl is a new feature of SharePoint 2013 that crawls content as it is modified or added to the sites. This can be resource intensive on large SharePoint sites. Alternatively, crawls can be scheduled for specific times.

  11. Click on OK.

How it works…

Search crawls in SharePoint are conducted on a per content source basis. Content sources define what is being crawled and how often. They can include SharePoint sites, websites, file shares, Microsoft Exchange public folders, line-of-business data from business data connectivity services connections, and custom repositories. Each content source defined can use multiple content sources of the same content type. For instance, a content source could include multiple, different websites. A content source, however, could not include both a website and a line-of-business data connection.

There's more…

Content sources can also be created and configured with PowerShell.

Configuring a search content source using PowerShell

Follow these steps to configure a content source using PowerShell:

  1. Assign our search service application to a variable using the Get-SPEnterpriseSearchServiceApplication Cmdlet:
    $ssa = Get-SPEnterpriseSearchServiceApplication "Search Service Application"
    
  2. Create a new content source with the New-SPEnterpriseSearchCrawlContentSource Cmdlet and assign it to a variable:
    $cs = New-SPEnterpriseSearchCrawlContentSource -Name "SharePoint Sites" -SearchApplication $ssa -Type SharePoint -SharePointCrawlBehavior CrawlVirtualServers -StartAddresses "http://sharepoint/"
    

    The SharePointCrawlBehavior parameter is the equivalent of the Crawl Settings section in the web interface. CrawlVirtualServers instructs the indexer to index all content under the URL provided and CrawlSites instructs the indexer to only index the site collection at the URL provided.

  3. Enable Continuous Crawl and then update the content source using the following commands:
    $cs.EnableContinuousCrawls = $true
    $cs.Update()
    

See also

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.210.102