MetadataFilter

User provided filter to limit retrieval based on Chunk or Document level metadata values. Example (genre = drama OR genre = action): key = "document.custom_metadata.genre" conditions = [{stringValue = "drama", operation = EQUAL}, {stringValue = "action", operation = EQUAL}]

JSON representation
{
  "key": string,
  "conditions": [
    {
      object (Condition)
    }
  ]
}
Fields
key

string

Required. The key of the metadata to filter on.

conditions[]

object (Condition)

Required. The Conditions for the given key that will trigger this filter. Multiple Conditions are joined by logical ORs.

Condition

Filter condition applicable to a single key.

JSON representation
{
  "operation": enum (Operator),

  // Union field value can be only one of the following:
  "stringValue": string,
  "numericValue": number
  // End of list of possible types for union field value.
}
Fields
operation

enum (Operator)

Required. Operator applied to the given key-value pair to trigger the condition.

Union field value. The value type must be consistent with the value type defined in the field for the corresponding key. If the value types are not consistent, the result will be an empty set. When the CustomMetadata has a StringList value type, the filtering condition should use string_value paired with an INCLUDES/EXCLUDES operation, otherwise the result will also be an empty set. value can be only one of the following:
stringValue

string

The string value to filter the metadata on.

numericValue

number

The numeric value to filter the metadata on.

Operator

Defines the valid operators that can be applied to a key-value pair.

Enums
OPERATOR_UNSPECIFIED The default value. This value is unused.
LESS Supported by numeric.
LESS_EQUAL Supported by numeric.
EQUAL Supported by numeric & string.
GREATER_EQUAL Supported by numeric.
GREATER Supported by numeric.
NOT_EQUAL Supported by numeric & string.
INCLUDES Supported by string only when CustomMetadata value type for the given key has a stringListValue.
EXCLUDES Supported by string only when CustomMetadata value type for the given key has a stringListValue.