SearchCondition
A structure that specifies a single search condition.
A condition compares the value of expression, evaluated for each object, with value using the
operator type. Common conditions:
| To find objects... | expression |
type |
value |
|---|---|---|---|
| that are not deleted | status value STATUS_TYPE_IS_DELETED |
CONDITION_TYPE_EQUAL |
Boolean false |
| of an object type | status value STATUS_TYPE_OBJECT_TYPE |
CONDITION_TYPE_EQUAL |
lookup, value list -11, item = object type ID |
| of a class | property value, property_def 100 |
CONDITION_TYPE_EQUAL |
lookup, value list 1, item = class ID |
| of any of several classes | property value, property_def 100 |
CONDITION_TYPE_EQUAL |
multi-select lookup of the class IDs |
| with an object ID | status value STATUS_TYPE_OBJECT_ID |
CONDITION_TYPE_EQUAL |
integer |
| whose title contains a text | property value, property_def 0 |
CONDITION_TYPE_CONTAINS |
text |
| that refer to a lookup item | property value of the lookup property | CONDITION_TYPE_EQUAL |
lookup of the item |
| whose property is empty | property value | CONDITION_TYPE_EQUAL |
the property's data type, is_null_value true |
| modified in the last 7 days | property value 21 with DATA_FUNCTION_DAYS_FROM |
CONDITION_TYPE_LESS_THAN_OR_EQUAL |
integer 7 |
| matching a full-text search | any field, search_metadata and/or search_filedata set |
CONDITION_TYPE_CONTAINS |
text |
| with a file name pattern | file value FILE_VALUE_TYPE_FILE_NAME |
CONDITION_TYPE_MATCHES_WILDCARD_PATTERN |
text such as *.pdf |
Property and value list IDs other than the built-in ones (0 Name or title, 20 Created, 21 Last modified, 100 Class; value list 1 for classes, -11 for object types) differ between vaults: resolve them by alias or GUID first. A condition the server cannot evaluate fails with "Invalid search condition."
| Full name | MFiles.SearchCondition |
|---|---|
| Proto file | mfiles/structs.proto |
Fields
| Field | Type | Number | Description |
|---|---|---|---|
expression | Expression | 1 | The left side of the condition: what is evaluated for each object, such as a property value, a status value or any field (full-text search). |
type | ConditionType | 2 | The comparison operator. |
value | TypedValue | 3 | The right side of the condition: the value to compare with. Its data type must suit the expression, for example a lookup for a lookup property, Boolean for STATUS_TYPE_IS_DELETED. |
Used by methods
- IRPCDataExport.SearchExportedObjects -- Searches objects in batches ordered by object ID, for paging through all objects that match.
- IRPCObjectOperations.CountObjectVersionsMatchingConditions -- Counts the versions of an object that DestroyObjectVersionsByConditions would destroy with the same inputs, without destroying anything.
- IRPCObjectOperations.DestroyObjectVersionsByConditions -- Destroys the old versions of an object that match search conditions, and returns how many were destroyed.
- IRPCSearch.GetSearchHits -- Finds the words of a text that a full-text search condition matches, for hit highlighting.
- IRPCValueLists.SearchValueListItemsWithPermissions -- Searches the items of one value list or object type by item ID, name, owner, parent or deleted state.
Used in fields
GroupingLevel.property_folder_filter-- The conditions that limit the values (property folders) of this expression.LookupItemRequest.search_conditions-- Item conditions, combined with AND, on the item pseudo properties 1-8 (for example 2 = name); see the IRPCValueLists overview.NotificationRule.object_filter-- The search conditions that an object must meet for the rule to apply, combined with AND. The built-in rules include a "not deleted" condition (STATUS_TYPE_IS_DELETEDequal to false).PropertyDef.value_list_item_filter-- A static filter on the items ofvalue_list. The server applies it when this property is passed asfiltering_property_deforLookupItemRequest.property_def; such conditions cannot be sent insearch_conditionsdirectly.SearchConditionArray.value-- The conditions. All of them must match.SearchDef.filter_conditions-- The conditions that limit the object set of this search.StateConditions.search_conditions-- Manual criteria.StateTransition.trigger_criteria-- The criteria for automatically triggered state transition.SearchExportedObjectsRequest.condition_array-- Search conditions, combined with AND. See SearchCondition and Search.DestroyObjectVersionsByConditionsRequest.conditions-- The conditions a version must match to be destroyed. Must not be empty.CountObjectVersionsMatchingConditionsRequest.conditions-- The conditions a version must match to be destroyed. Must not be empty.GetSearchHitsRequest.search_condition-- The full-text search condition that specifies the search words (Represented by SearchCondition sturct).SearchValueListItemsWithPermissionsRequest.search_conditions-- Conditions on the item pseudo properties 1-8 (see the service overview), combined with AND. Empty returns all items, deleted ones included.