We have a large document library with 3000+ folders. Our customer wants to be able to search within the current folder. Because this document library has a lot of folders creating one scope per folder is out of question. So the question is: How can a search be limited to current folder in a doc library?
Thanks
Here is how you can restrict the SharePoint search to fetch results only from the specific content source. In Add Result Source page, Provide a Name to the Result Source and optionally a description. Leave the option buttons for Protocol as “Local SharePoint” and Type as “SharePoint Search Results”.
On the List Settings page, under General Settings, click Advanced settings. In the Search section, under Allow items from this document library to appear in search results, select Yes to include all of the items in the list or library in search result or No to exclude all items from search results.
Open the list or library that contains the folder, document, or list item, on which you want to edit permission levels. Click the drop-down menu to the right of the folder, document, or list item on which you want to edit permission levels, and then click Manage Permissions.
By typing a phrase up here, SharePoint will show you a selection of files and folders that are related to your search query. For example, if you type "Security" into the search bar, SharePoint Online will show you documents with Security in the title, content, or metatags.
Off hand I would say that you would need to implement a custom search feature and access the Search API directly. More importantly is that you seem to be suffering from a case of FileShareism. I've seen many a SharePoint implementation suffer and die from this affliction.
If you want to limit to a document library:
This is already built in. When you are viewing a document library, the search box in the upper right defaults to "This List: NameOfDocLib". Searching here will limit the scope to the document library.
If you want to search individual folders:
This is built in to windows. Use the built in windows explorer search.
Tell your customers to open the folder in explorer view. Right click on your folder you want to search and select search.
Don't tell your customer that this was all built in. Take credit for it. Profit! :)
@webwires I agree about the 3000 folders. You should really think about breaking that out into multiple document libraries.
What worked for me, was really fine-tuning my search scope. Made sure that I was using "include" as a behavior type. Then setting my web address (non-secure URL), to the document library folder I wanted to crawl.
I knew things were golden after the 15 minute crawl as I noticed my item count was greater than 0!
I then made sure that my web page (which was a search center site now converted into a v4 template), was able to have my search box web-part on it, and redirect search results to a results.aspx page under the same sub site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With