Is it possible in SPO search to build a query that will return only documents that are directly in a document library (not in folders)? is there any property that can tell whether specific document is placed in a folder or not?
1 Answer
Yes, you should be able to use url depth to locate the files in the root of the library
-
As I can see, it's not possible to recognize in url which word is a folder name. Subsite, document library or folder name is just a word after \. See below example: document in root of the library: company.sharepoint.com/:w:/r/sites/Site1/SubSite1/… document in a folder: company.sharepoint.com/:w:/r/sites/Site1/SubSite1/…– PrzlwoCommented Feb 8, 2019 at 8:11
-
from above two urls how to recognize that folder1 is really folder name (not a library) ?– PrzlwoCommented Feb 8, 2019 at 8:31
-
Try to inspect the library in the SharePoint Search Query Tool, and have a look at the managed properties isDocument and UrlDepth. That should be sufficient to pinpoint the documents Commented Feb 8, 2019 at 22:54