How to search document from only one document library in SharePoint 2013.
Filter on the Path managed property. For example, if your list is located at
http://yourwebapp/yoursite/yourweb/lists/yourlistthen your search would be
Also, if you are using a certain content type in the list, you can use the content type filter. For example, ContentType:yourcontenttypename
Edit: You could also use the ListId managed property which is auto-populated. You can get the list GUID for the document library by going to the document library settings page and getting the id from the URL (it looks like something like feff2548-dd30-4372-80d1-c20a1a14b710) then your query would be ListId:feff2548-dd30-4372-80d1-c20a1a14b710
Just an FYI that in O365 SharePoint, I can only get the Path managed property to filter properly when I include the URL only in quotation marks. (See below).
But this does not:
And neither does this:
I have not tested this criteria in an on-prem environment.
- Add Content Search webpart to page and edit the web part properties
- Click on Change Query - This will open the query builder modal dialog
- In order to display the documents from a specific library - Enter the list URL in the Restrict app section
- Click OK and Save the page
You can use the "path" restrictor. So in the search box you could put something like this:
terms to search for path:http://SERVER.com/SITE/LIBRAY
The "path:http://SERVER.com/SITE/LIBRAY" part of the query tells the search engine to look for the search terms only under the path given, and any of its children.
you could define a custom result source (search scope) to limit queries to this library and then have a custom page to render those results. Check this post for info on that: http://sharepointbrandon.com/2013/07/setup-multiple-search-pages-result-sources-search-scopes-for-a-site-search-in-sharepoint-2013/