enable searching within doc libraries and folders
I would like to be able to narrow my search to a specific document library or folder so that the search returns results only from the doc library or folder and any folders or subfolders below them.
Thanks for your feedback! We’d like to understand better. Are you thinking of searching from a site, or from a document library?
I have the use case where I want to limit the default modern search to my current site. However, I would also like to have the ability to put a targetted search web part with optional refiners on my site page, specifying a particular document library as the scope, so that I can have a doclib web part on a page exposing that library, linked to the search web part.
And if that is possible for a document library, then the same targetted search model should also work for custom lists
Joran Markx commented
From a document library. It seems to work well for small libraries. But when you have a lot of items in the library, the "search as you type" does work, but pressing Enter will result in an empty resultset. Just as David commented.
The comments so far are not suitable for end users though?
The current document library search is poor IMO. Especially if a document library has more than 5000 items. At present if there are more than 5000 items in a library the search can sometimes return zero results. This is because the search is actually filtering the items and as we all know the View Limit Threshold causes this to fail. :-(
[Deleted User] commented
You can also create a result source and use query builder to build your query which acts like scope.
This is already possible using a Content Search Web Part, and specifying the path that you want results from. There are lots of articles online on how to do it.