I have created the Search Service Application and my Search is working fine. But my current requirement is I need to search for documents within a specific Document Library. Currently my search result page shows all the results from the whole site. My requirement is to show a documents from a single document library. How can I achieve this.
2 Answers
Create a search scope and give URL for your specific document library only in the rule.
For details please check this link.
Update: For SharePoint 2013 you need to create a Results Source and configure query to search in particular library only and configure your Search Results WebPart to use your Results Source.
Please check this link
-
Thanks Varun. But I am using Sharepoint 2013. So is there anything for Sharepoint 2013 for a specific document library.– SushriAug 6, 2014 at 10:21
-
-
In addition to creating a result source (search scope), you can also simply provide the relevant query text directly in the search result web part of your search page. (See below).
NOTE: Be sure to include quotation marks around the URL path, I could not get it work otherwise.
{searchboxquery} path:"https://siteURL.com/DocumentLibraryName/*"
For multiple locations, simply add them with a space delimiter.
{searchboxquery} path:"https://siteURL.com/DocumentLibrary1/*" path:"https://siteURL/DocumentLibrary2/*" path:"https://siteURL/DocumentLibrary2/*"
-
1
-