# SearchFlags

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

Search flags.

Leave unset for the usual search: the latest version of each object, all object types in one
relevance-ranked result list.

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

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

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-all"></a>`all` | `bool` | 1 | All flags set, including any future flags. Do not use in searches. |
| <a id="f-look_in_all_versions"></a>`look_in_all_versions` | `bool` | 2 | Also match older versions; each object is returned once. Cannot be combined with `sorting`, and `GetObjectCountInSearch` rejects it. |
| <a id="f-return_latest_visible_version"></a>`return_latest_visible_version` | `bool` | 3 | Return the latest visible version for each matching document. |
| <a id="f-separately_search_in_each_object_type"></a>`separately_search_in_each_object_type` | `bool` | 4 | Search each object type separately and merge the results. The `limit` then applies to each object type, and `pages_with_more_results` lists the object types whose results were cut. |
| <a id="f-allow_quick_refresh_for_external_object_types"></a>`allow_quick_refresh_for_external_object_types` | `bool` | 5 | If a search with an external ID condition on an external object type finds nothing, refresh the object type from its external database and search again. |
| <a id="f-disable_relevancy_ranking"></a>`disable_relevancy_ranking` | `bool` | 6 | Do not rank the results by relevance. |
| <a id="f-separately_search_specific_object_types"></a>`separately_search_specific_object_types` | `bool` | 7 | Allows only specified object types to be searched separately. |
| <a id="f-include_unmanaged_objects"></a>`include_unmanaged_objects` | `bool` | 8 | Extends the search to include unmanaged objects. |
| <a id="f-individual_limit_for_each_external_repository"></a>`individual_limit_for_each_external_repository` | `bool` | 9 | Ensures that up to the specified maximum number of results are returned from each repository. |

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

## Used by methods

- [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.GetObjectsCountForNotifications](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/GetObjectsCountForNotifications/index.md): Gets the objects count for notification badge.
- [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

- [`SearchDef.options`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchDef/index.md#f-options): Search flags. This affects the resulting object version set and also distinct view level values displayed inside this search.
- [`GetObjectCountInSearchRequest.searchflags`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/GetObjectCountInSearch/index.md#request): Search flags. `look_in_all_versions` and `return_latest_visible_version` are not supported and fail with "Invalid search condition."
- [`GetObjectsCountForNotificationsRequest.search_flags`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/GetObjectsCountForNotifications/index.md#request): Search flags. Supports 'INCLUDE_UNMANAGED_OBJECTS' flag only.
- [`SearchObjectsRequest.options`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/SearchObjects/index.md#request): Search flags. Unset searches the latest versions of all object types as one relevance-ranked list. See [SearchFlags](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchFlags/index.md).
