---
title: "performTextSearchWithQueryString:usingOptions:resultAggregator:"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitextsearching-53wjq/performtextsearchwithquerystring:usingoptions:resultaggregator:"
---

# performTextSearchWithQueryString:usingOptions:resultAggregator:

Searches for ranges of text matching the string across all searchable documents and collects results in the aggregator.

## Declaration

```occ
- (void) performTextSearchWithQueryString:(NSString *) string usingOptions:(UITextSearchOptions *) options resultAggregator:(id<UITextSearchAggregator>) aggregator;
```

## Parameters

- `string`: The string to search for.
- `options`: The configurable options to use for matching words and comparing strings.
- `aggregator`: An object you use to collect matching results. The aggregator is thread-safe, so you may send it messages on other threads.

## Discussion

Discussion The system calls this method during a find session to perform the search. Your implenentation should search for matching text ranges in your app’s documents and call foundRange(_:searchString:document:) on the aggregator object to add them to the set of matching ranges.

## See Also

### Handling searches

- [UITextSearchAggregator](uikit/uitextsearchaggregator-c.protocol.md)
- [compareFoundRange:toRange:inDocument:](uikit/uitextsearching-53wjq/comparefoundrange:torange:indocument:.md)
- [compareOrderFromDocument:toDocument:](uikit/uitextsearching-53wjq/compareorderfromdocument:todocument:.md)
- [UITextSearchDocumentIdentifier](uikit/uitextsearchdocumentidentifier.md)
