# SearchViewState

> Create search view flags used to create a new Search window.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEditor.Search](/engine/6000.6/script-reference/unityeditor/search.md)
* **Assembly:** UnityEditor

## SearchViewState(SearchContext)

Create search view flags used to create a new Search window.

```csharp
public SearchViewState(SearchContext context)
```

### Parameters

**** (\[SearchContext]\(/engine/6000.6/script-reference/unityeditor/search/searchcontext)): Initial search context.

### Remarks

See [SearchService.ShowWindow](/engine/6000.6/script-reference/unityeditor/search/searchservice/showwindow.md).

## SearchViewState(SearchContext, SearchViewFlags)

Create search view flags used to create a new Search window.

```csharp
public SearchViewState(SearchContext context, SearchViewFlags flags)
```

### Parameters

**** (\[SearchContext]\(/engine/6000.6/script-reference/unityeditor/search/searchcontext)): Initial search context.**** (\[SearchViewFlags]\(/engine/6000.6/script-reference/unityengine/search/searchviewflags)): Initial search view flags.

### Remarks

See [SearchService.ShowWindow](/engine/6000.6/script-reference/unityeditor/search/searchservice/showwindow.md).

## SearchViewState(SearchContext, Action\<SearchItem, bool>)

Creates a search view state that will be used to open a search picker using [SearchService.ShowPicker](/engine/6000.6/script-reference/unityeditor/search/searchservice/showpicker.md).

```csharp
public SearchViewState(SearchContext context, Action<SearchItem, bool> selectHandler)
```

### Parameters

**** (\[SearchContext]\(/engine/6000.6/script-reference/unityeditor/search/searchcontext)): Initial search context.**** (\[Action\<SearchItem, bool>]\(https\://learn.microsoft.com/dotnet/api/system.action)): Handler executed when the user has selected an search result.

## SearchViewState(SearchContext, Action\<Object, bool>, Action\<Object>, string, Type)

Creates a search view state that will be used to open a search picker using [SearchService.ShowPicker](/engine/6000.6/script-reference/unityeditor/search/searchservice/showpicker.md).

```csharp
public SearchViewState(SearchContext context, Action<Object, bool> selectObjectHandler, Action<Object> trackingObjectHandler, string typeName, Type filterType)
```

### Parameters

**** (\[SearchContext]\(/engine/6000.6/script-reference/unityeditor/search/searchcontext)): Initial search context.**** (\[Action\<Object, bool>]\(https\://learn.microsoft.com/dotnet/api/system.action)): Handler executed when the user has selected an object.**** (\[Action\<Object>]\(https\://learn.microsoft.com/dotnet/api/system.action)): Handler executed when the user clicks on an item in the search view.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): String type name used to filter items in the search results. This parameter can be defined if the concrete Type cannot be accessed.**** (\[Type]\(https\://learn.microsoft.com/dotnet/api/system.type)): Concrete type used to filter items in the search results.

## SearchViewState(SearchContext, SearchTable, SearchViewFlags)

Creates a search view that will be opened in table view.

```csharp
public SearchViewState(SearchContext context, SearchTable tableConfig, SearchViewFlags flags = SearchViewFlags.None)
```

### Parameters

**** (\[SearchContext]\(/engine/6000.6/script-reference/unityeditor/search/searchcontext)): Initial search context.**** (\[SearchTable]\(/engine/6000.6/script-reference/unityeditor/search/searchtable)): Initial search table configuration.**** (\[SearchViewFlags]\(/engine/6000.6/script-reference/unityengine/search/searchviewflags)): Initial search view flags.
