Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SearchFlags

Search options used to fetch items. Mostly with SearchContext to specify how a search should be handled.
Read time 2 minutesLast updated 4 days ago

Definition

[Flags]public enum SearchFlags

Examples

using System.Collections.Generic;using UnityEditor;using UnityEditor.Search;using UnityEngine;public class SearchFlags_NoIndexing{ [MenuItem("Examples/SearchFlags/NoIndexing")] public static void RequestAll() { // Find all assets matching the word Search without using any indexed data (will rely on the Find Files provider). SearchService.Request("p: Search", (SearchContext context, IList<SearchItem> items) => { foreach (var item in items) Debug.Log(item); }, SearchFlags.NoIndexing); }}

Fields

Value

Description

AllProvidersAvailableAll SearchProviders are available in the SearchWindow dropdown menu.
DebugAdds debugging information to SearchItem while looking for results.
DefaultDefault Search Flag (SearchFlags.Sorted).
DockableIndicates that the search view is dockable. This flag is only usable with internal API.
ExpressionIndicates that the search query will be evaluated as a search expression.
FocusContextIndicates that the search view will focus on the first contextual search provider available when it opens. This flag is only usable with internal API.
GeneralSearchWindowThis is a general purpose search window that has access to all Providers in the SearchService.
HidePanelsIndicates that the search view will hide its side panels when it opens. This flag is only usable with internal API.
MultiselectIndicates that the search view will allow multi-selection. This flag is only usable with internal API.
NoIndexingPrevents the search from using indexing. Asset Provider will use its builtin Find in Files provider.
NoneNo specific search options. Result will be unsorted.
OpenContextualOpens a search view with default contextual options. This flag is only usable with internal API.
OpenDefaultOpens a search view with default options. This flag is only usable with internal API.
OpenGlobalOpens a search view for a global search. This flag is only usable with internal API.
OpenPickerOpens a search view as an object picker. This flag is only usable with internal API.
PackagesThe Object Picker window will include any results from packages.
QueryStringEvaluate the search text as a pure query string (do not evaluate the text as a search expression).
ReuseExistingWindowIndicates that the search view will find any existing window instances that are already opened before creating a new one. This flag is only usable with internal API.
ShowErrorsWithResultsAlways show query errors even when there are results available. This flag is only usable with internal API.
SynchronousSearch items are fetched synchronously. This can take a long time for some SearchProvider (like asset). Use at your own risk.
UseSessionSettingsPersist the SearchContext state in between sessions using the SearchViewState.sessionName as its data key.
WantsMoreSets the search to search for all results. This might take longer than unusual if SearchProvider are using multiple sources of items (files on disk, AssetDatabase...)