# SearchMode

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) > [Enums](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/index.md)

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

Search mode enumeration.

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

<a id="values"></a>

## Values

| Name | Number | Description |
|---|---|---|
| <a id="v-SEARCH_MODE_DEFAULT"></a>`SEARCH_MODE_DEFAULT` | 0 | Default mode (always the case in versions before 19.1). The search is executed using the full-text search engine if it contains an AnyField condition. Otherwise the search is executed against the database. |
| <a id="v-SEARCH_MODE_FAVOR_FULL_TEXT_SEARCH"></a>`SEARCH_MODE_FAVOR_FULL_TEXT_SEARCH` | 1 | Favors executing the search with the full-text search engine if technically possible. The search is executed using the full-text search engine even if no AnyField condition exists if the search conditions are supported by the target search index. In other cases the search is executed against the database. |
| <a id="v-SEARCH_MODE_REQUIRE_FULL_TEXT_SEARCH"></a>`SEARCH_MODE_REQUIRE_FULL_TEXT_SEARCH` | 2 | Requires executing the search with the full-text search engine. If the search conditions are not supported by the target search index, an error is returned. |
| <a id="v-SEARCH_MODE_REQUIRE_DATABASE_SEARCH"></a>`SEARCH_MODE_REQUIRE_DATABASE_SEARCH` | 3 | Requires executing the search against the database. If the search conditions are not compatible with executing the search against the database, an error is returned. |

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

## Used in fields

- [`SearchTarget.mode`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchTarget/index.md#f-mode): 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).
