# SearchDef

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Reference](https://developer.m-files.com/APIs/gRPC-API/Reference/index.md) > [Messages](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchDef/

Struct for a search definition.

- **Full name:** `MFiles.SearchDef`
- **Proto file:** [`mfiles/structs.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/structs.proto)

<a id="fields"></a>

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-filter_conditions"></a>`filter_conditions` | repeated [`SearchCondition`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchCondition/index.md) | 1 | The conditions that limit the object set of this search. |
| <a id="f-grouping_levels"></a>`grouping_levels` | repeated [`GroupingLevel`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.GroupingLevel/index.md) | 2 | View levels (the display hierarchy of this search). |
| <a id="f-options"></a>`options` | [`SearchFlags`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchFlags/index.md) | 3 | Search flags. This affects the resulting object version set and also distinct view level values displayed inside this search. |

<a id="used-in-fields"></a>

## Used in fields

- [`FolderInfoUnion.SearchFolderData.search_definition`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FolderInfoUnion/index.md#t-SearchFolderData-search_definition): The search definition that contains the view levels and search conditions of this search folder.
- [`View.content_definition`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.View/index.md#f-content_definition): The search definition that contains the view levels and search conditions of the view.
