Version: 2021.2
LanguageEnglish
  • C#

SearchContext

class in UnityEditor.Search

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

The search context includes all the data necessary to perform a query. It allows the full customization of how a query may be performed.

Properties

filterIdExplicit 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.
focusedWindowEditor window that initiated the search.
optionsSearch context options.
progressIdProgress handle to display the progress bar for the search currently in progress.
providersWhich search providers are active for this particular context.
searchInProgressIndicates if an asynchronous search is currently in progress for this context.
searchPhraseReturns a phrase that contains only words separated by spaces.
searchQueryProcessed search query (no filterId, no textFilters).
searchQueryOffsetCharacter offset of the processed search query in the raw search text.
searchTextRaw search text (what is in the Search text box).
searchViewThe search view presenting the search results.
searchWordsSearch query tokenized by words. All text filters are discarded and all words are in lowercase.
selectionReturns the search result selection if any.
textFiltersAll tokens containing a colon (':').
wantsMoreIndicates if the search should return all the results instead of only the most relevant.

Constructors

SearchContextCreates a new search context.

Public Methods

AddSearchQueryErrorAdds a new query error on this context.
AddSearchQueryErrorsAdds new query errors on this context.
DisposeDispose of the Search Context.
IsEnabledChecks if a search provider is available to process a query.
SetFilterEnables or disables a single search provider. A disabled search provider won't be asked to provide items to resolve the query.

Events

asyncItemReceivedThis event is used to receive any asynchronous search result.
sessionEndedInvoked when a Search has ended.
sessionStartedInvoked when a Search is started.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961