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:
- The source’s name: PDF Results
- Its description: Results with file extension .pdf
- Because we want items crawled by SharePoint, keep the Protocol on Local SharePoint.
- Because we don’t want People results, keep the Type on SharePoint Search Results.
- 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:
- 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.
- 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