3

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 2

6

Create a search scope and give URL for your specific document library only in the rule.

For details please check this link.

Help 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

3
  • Thanks Varun. But I am using Sharepoint 2013. So is there anything for Sharepoint 2013 for a specific document library.
    – Sushri
    Aug 6, 2014 at 10:21
  • See my Updated Answer Aug 6, 2014 at 10:28
  • Please mark it as answer if it solves your query Aug 6, 2014 at 10:40
13

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/*"

enter image description here

2
  • 1
    This is a much better answer Feb 7, 2017 at 17:33
  • Can we query for specific folder in a Document Library ??
    – Yayati
    Mar 17, 2017 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.