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.
You can retrieve the paths of files by searching files before configuring the result source.
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.