<!--
{
  "availability" : [
    "macOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FileProvider",
  "identifier" : "/documentation/FileProvider/NSFileProviderSearching",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "File Provider"
    ],
    "preciseIdentifier" : "c:objc(pl)NSFileProviderSearching"
  },
  "title" : "NSFileProviderSearching"
}
-->

# NSFileProviderSearching

A protocol you implement to support searching in your file provider.

```
protocol NSFileProviderSearching : NSObjectProtocol
```

## Overview

Implement this protocol in your provider’s principal class to support searching files in cloud storage.
To make search available to the person using the device, also set the property [`supportsStringSearchRequest`](/documentation/FileProvider/NSFileProviderDomain/supportsStringSearchRequest) to `true`.

> Tip: You don’t need to implement this protocol if you only want to expose the contents of the working set to system search.

When the person using the device performs a search, the system calls the `NSFileProviderSearching` implementation for all the accounts they’ve chosen to search.
Your implementation returns a [`NSFileProviderSearchEnumerator`](/documentation/FileProvider/NSFileProviderSearchEnumerator), which receives repeated callbacks to [`enumerateSearchResults(for:startingAt:)`](/documentation/FileProvider/NSFileProviderSearchEnumerator/enumerateSearchResults(for:startingAt:)) until one of the following occurs:

- The system has received enough results.
- The system has received all results.
- The person enters another character into the query string, thereby canceling this search and starting another.
- The person explicitly cancels the search.

## Topics

### Implementing search

[`searchEnumerator(for:)`](/documentation/FileProvider/NSFileProviderSearching/searchEnumerator(for:))

Provides an object that enumerates over search results, in response to a call from the system.

[`NSFileProviderStringSearchRequest`](/documentation/FileProvider/NSFileProviderStringSearchRequest)

A type that contains details of a string-based search request.

[`NSFileProviderSearchEnumerator`](/documentation/FileProvider/NSFileProviderSearchEnumerator)

A protocol that defines methods for providing search results and canceling searches.



---

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)