Preaching SharePoint

Create a PDF Result Scope\Source in SharePoint 2013


In SharePoint 2013 the “Scopes” are replaced by a new thing called “Result Sources”. By replaced I mean you cannot Create or use the Search scopes anymore. No more displaying a custom search scope in a Drop-down next to search box. Only two system Search scopes All Sites and People will be available at search results page.

Result Sources are actually the combination of Federated Search and Search Scopes. In SharePoint 2013 you can Create a new Result Source and specify the “Protocol” (to search Local SharePoint or Remote SharePoint farm etc..) and can specify the “Query Transformation”.Lets look at the example of how to create a Result Source that only returns PDF results. Navigate to site settings -> Result Sources.



Next, click New Result Source and set the following:

  1. The source’s name: PDF Results
  2. Its description: Results with file extension .pdf
  3. Because we want items crawled by SharePoint, keep the Protocol on Local SharePoint.
  4. Because we don’t want People results, keep the Type on SharePoint Search Results.
  5. Its Query Transform: {searchTerms} fileextension:pdf






Query Transforms are very powerful, so we’ll discuss them in depth in another post. For now, the key is that Result Sources use their transform to guarantee only certain results. The transform does this by replacing the incoming query with whatever you type here.

Wait…replacing the query?

That’s right. And that means two things:

  1. To add a restriction to the incoming query, you need to include its query text as part of the transform. This is what {searchTerms} does. It’s a query variable that is automatically swapped out for the incoming query’s text.
  2. You can use Search syntax to restrict results. This is a lot easier than managing Search Scope Rules in SharePoint 2010 Products. Want only PDFs? Use {searchTerms} fileextension:pdf. Only PDFs not in a certain site? Use {searchTerms} (fileextension:pdf AND NOT site:path/to/site). And you don’t have to wait for anything to update, either.

Since we want only PDF results, use {searchTerms} fileextension:pdf.

Finally, click OK, and you’ve created your PDF Results source.



Responses

0 Respones to "Create a PDF Result Scope\Source in SharePoint 2013"

Post a Comment

 

Do you want SharePoint 2013 to inherit Metro Style design?

Search This Blog

Return to top of page Copyright © 2010 | Platinum Theme Converted into Blogger Template by HackTutors