<!--
{
  "documentType" : "article",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/metadata-query-search-scopes",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Metadata Query Search Scopes"
}
-->

# Metadata Query Search Scopes

Constants for the predefined search scopes used by [`searchScopes`](/documentation/Foundation/NSMetadataQuery/searchScopes).

## Topics

### Constants

[`NSMetadataQueryUserHomeScope`](/documentation/Foundation/NSMetadataQueryUserHomeScope)

Search the user’s home directory.

[`NSMetadataQueryLocalComputerScope`](/documentation/Foundation/NSMetadataQueryLocalComputerScope)

Search all local mounted volumes, including the user home directory. The user’s home directory is searched even if it is a remote volume.

[`NSMetadataQueryNetworkScope`](/documentation/Foundation/NSMetadataQueryNetworkScope)

Search all user-mounted remote volumes.

[`NSMetadataQueryUbiquitousDocumentsScope`](/documentation/Foundation/NSMetadataQueryUbiquitousDocumentsScope)

Search all files in the `Documents` directories of the app’s iCloud container directories.

[`NSMetadataQueryUbiquitousDataScope`](/documentation/Foundation/NSMetadataQueryUbiquitousDataScope)

Search all files not in the `Documents` directories of the app’s iCloud container directories.

[`NSMetadataQueryAccessibleUbiquitousExternalDocumentsScope`](/documentation/Foundation/NSMetadataQueryAccessibleUbiquitousExternalDocumentsScope)

Search for documents outside the app’s container. This search can locate iCloud documents that the user previously opened using a document picker view controller. This lets your app access the documents again without requiring direct user interaction. The result’s [`NSMetadataItemURLKey`](/documentation/Foundation/NSMetadataItemURLKey) attributes return security-scoped NSURLs. For more information on working with security-scoped URLs, see [`Security-Scoped URLs`](/documentation/Foundation/NSURL#Security-Scoped-URLs) in [`NSURL`](/documentation/Foundation/NSURL).

[`NSMetadataQueryIndexedLocalComputerScope`](/documentation/Foundation/NSMetadataQueryIndexedLocalComputerScope)

Search all indexed local mounted volumes including the current user’s home directory (even if the home directory is remote).

[`NSMetadataQueryIndexedNetworkScope`](/documentation/Foundation/NSMetadataQueryIndexedNetworkScope)

Search all indexed user-mounted remote volumes.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)