# SearchTarget

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.SearchTarget/

Search options.

Leave unset to search the vault's default index in `SEARCH_MODE_DEFAULT`, where the full-text
search engine is used only for searches with a full-text (any-field) condition.

- **Full name:** `MFiles.SearchTarget`
- **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-index"></a>`index` | `string` | 1 | The name of the search index to use. Empty uses the vault's default index. An unknown name fails with "Target index is not available." |
| <a id="f-mode"></a>`mode` | [`SearchMode`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.SearchMode/index.md) | 2 | Whether to prefer, require or avoid the full-text search engine. See [SearchMode](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.SearchMode/index.md). Values: `SEARCH_MODE_DEFAULT` (0), `SEARCH_MODE_FAVOR_FULL_TEXT_SEARCH` (1), `SEARCH_MODE_REQUIRE_FULL_TEXT_SEARCH` (2), `SEARCH_MODE_REQUIRE_DATABASE_SEARCH` (3). |
| <a id="f-search_master_storage"></a>`search_master_storage` | `bool` | 3 | True to also search objects kept in Master Storage, where the vault supports it. |
| <a id="f-continuation_token"></a>`continuation_token` | `string` | 4 | Continuation token for paging results from Master Storage. `SearchObjects` does not support it and fails with "Continuation token is not supported." when it is set together with `search_master_storage`. |

<a id="used-by-methods"></a>

## Used by methods

- [IRPCSearch.GetFacetValues](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/GetFacetValues/index.md): Retrieves the facet values for the documents that satisfy the specified search conditions.
- [IRPCSearch.GetFolderContents](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/GetFolderContents/index.md): Lists the contents of a view or a view level: subviews, grouping folders and objects.
- [IRPCSearch.GetFolderContentsOrDelta](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/GetFolderContentsOrDelta/index.md): Gets the contents of the specified folder, or a delta that indicates changes to document vault data since the logical timestamp known by the caller.
- [IRPCSearch.GetFolderObjectsCount](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/GetFolderObjectsCount/index.md): Gets the count of objects in the specified folder.
- [IRPCSearch.GetObjectCountInSearch](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/GetObjectCountInSearch/index.md): Counts the objects that match the given conditions without returning them.
- [IRPCSearch.GetSearchHits](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/GetSearchHits/index.md): Finds the words of a text that a full-text search condition matches, for hit highlighting.
- [IRPCSearch.SearchObjects](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/SearchObjects/index.md): Searches the vault for objects that match the given conditions.

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

## Used in fields

- [`GetFolderObjectsCountRequest.search_options`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/GetFolderObjectsCount/index.md#request): Search options.
- [`GetFacetValuesRequest.search_options`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/GetFacetValues/index.md#request): Search options.
- [`GetSearchHitsRequest.search_options`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/GetSearchHits/index.md#request): Search options.
- [`GetObjectCountInSearchRequest.search_options`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/GetObjectCountInSearch/index.md#request): The search index and search mode. Leave unset for the vault's default index.
- [`SearchObjectsRequest.target`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/SearchObjects/index.md#request): The search index and search mode. Leave unset to use the vault's default index and `SEARCH_MODE_DEFAULT`. An unknown index name fails with "Target index is not available."
- [`GetFolderContentsOrDeltaRequest.search_options`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/GetFolderContentsOrDelta/index.md#request): Search options.
- [`GetFolderContentsRequest.target`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/GetFolderContents/index.md#request): Search options.
