0

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

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/… – Przlwo Feb 8 at 8:11
  • from above two urls how to recognize that folder1 is really folder name (not a library) ? – Przlwo Feb 8 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 – Kasper Bo Larsen Feb 8 at 22:54

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.