The search context includes all the data necessary to perform a query. It allows the full customization of how a query may be performed.
empty | Indicates of the search query is empty. This exclude the search filter id. In example if the search text is h: , then this property will still return true. |
filterId | Explicit filter ID. Usually it is the first search token like h:, p: to do an explicit search for a given search provider. Can be null. |
focusedWindow | Editor window that initiated the search. |
options | Search context options. |
progressId | Progress handle to display the progress bar for the search currently in progress. |
providers | Which search providers are active for this particular context. |
searchInProgress | Indicates if an asynchronous search is currently in progress for this context. |
searchPhrase | Returns a phrase that contains only words separated by spaces. |
searchQuery | Processed search query (no filterId, no textFilters). |
searchQueryOffset | Character offset of the processed search query in the raw search text. |
searchText | Raw search text (what is in the Search text box). |
searchView | The search view presenting the search results. |
searchWords | Search query tokenized by words. All text filters are discarded and all words are in lowercase. |
selection | Returns the search result selection if any. |
textFilters | All tokens containing a colon (':'). |
wantsMore | Indicates if the search should return all the results instead of only the most relevant. |
SearchContext | Creates a new search context. |
AddSearchQueryError | Adds a new query error on this context. |
AddSearchQueryErrors | Adds new query errors on this context. |
Dispose | Dispose of the Search Context. |
IsEnabled | Checks if a search provider is available to process a query. |
SetFilter | Enables or disables a single search provider. A disabled search provider won't be asked to provide items to resolve the query. |
asyncItemReceived | This event is used to receive any asynchronous search result. |
sessionEnded | Invoked when a Search has ended. |
sessionStarted | Invoked when a Search is started. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.