<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreSpotlight",
  "identifier" : "/documentation/CoreSpotlight/SpotlightSearchTool/searchResults",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core Spotlight",
      "FoundationModels"
    ],
    "preciseIdentifier" : "s:31_CoreSpotlight_FoundationModels0B10SearchToolV13searchResultsQrvp"
  },
  "title" : "searchResults"
}
-->

# searchResults

An asynchronous stream that delivers the results of a search to your app for processing.

```
var searchResults: some AsyncSequence<SpotlightSearchTool.SearchReply, Never> { get }
```

## Discussion

Use this property to monitor the search results as the tool generates them. Each time the
model calls the Spotlight search tool’s <doc://com.apple.documentation/documentation/FoundationModels/Tool/call(arguments:)>
method, the tool generates one or more [`SpotlightSearchTool.SearchReply`](/documentation/CoreSpotlight/SpotlightSearchTool/SearchReply) structures with information about
the results. Use this information to track the tool’s behavior while responding to the model’s requests.

Monitor the asynchronous stream using a `for await` loop in a separate task, as shown in the following example:

```swift
let tool = SpotlightSearchTool()
let session = LanguageModelSession(tools: [tool])

Task {
    for await result in tool.searchResults {
        // Process each search result as it arrives.
    }
}

let response = try await session.respond(to: "Show me recent emails from Shelly”)
```

For more information about how to process search results, see [Making your indexed content available to Foundation Models](/documentation/CoreSpotlight/making-your-indexed-content-available-to-foundation-models).

---

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)