question

TanmoyDas-9282 avatar image
0 Votes"
TanmoyDas-9282 asked AllenXu-MSFT commented

Search scope a particular folder in library

Hi,

Can I set a particular folder in Pages and Doc library as my search scope in SharePoint 2013

Thanks

office-sharepoint-server-administration
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AllenXu-MSFT avatar image
0 Votes"
AllenXu-MSFT answered AllenXu-MSFT commented

Hi anonymous user ,

Do you want to search all files under a specific folder?

If you use contenttype:folder title:YourFolderName to search, it only returns the folder instead of files under the folder.

The OOB way to achieve your requirement may be a kind of complicated. You can create a Result Source which contains all paths of the files in the folder. The way may be a little complicated since KQL queries don’t support suffix matching, so you can’t configure Path=http://*/FolderName in Query text to search items under “FolderName” folder. You need to type all paths of files like below. Or you can achieve it by coding.
102886-image.png

You can retrieve the paths of files by searching files before configuring the result source.
102963-image.png
How to configure the Search Results Web Part to use a new result source in SharePoint 2013 for your reference:
http://blogs.technet.com/b/tothesharepoint/archive/2013/11/06/how-to-configure-the-search-results-web-part-to-use-a-new-result-source-in-sharepoint-2013.aspx


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


image.png (47.2 KiB)
image.png (13.9 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

anonymous user,

Is there any update on this thread? I'm looking forward to your reply :-)

0 Votes 0 ·

anonymous user

If an answer is helpful to you, don't forget to accept it as answer :-)

0 Votes 0 ·