Operators
Operators are the fundamental building blocks of Clinia’s filtering and selection language, enabling you to define conditions that records must satisfy across various platform features. Whether you are working with resources, relationships, or objects, operators provide a unified interface for expressing complex logic when searching, filtering, or validating records throughout your data workflows.Understanding Operators
Operators in Clinia work by defining conditions that records must satisfy to be selected for a particular operation. Whether you’re searching for specific records, configuring conditional ingestion steps, setting up field validation rules, or filtering data for processing, operators provide the precise control you need. Each operator is designed for specific data types and use cases, from simple equality checks to complex semantic similarity matching.Where Operators Are Used
Operators are currently used in two main areas of the Clinia platform:Data Partition API
- Record filtering: Filter and retrieve specific records from data partitions (resources, relationships, or objects)
- Transactional queries: Define precise selection criteria for search operations
- Hybrid Search queries: Combine different matching strategies (semantic, lexical)
Registry API
- Data quality rules: Define validation criteria that fields must satisfy
- Conditional processing: Apply transformations only when records meet specific criteria
- Pipeline routing: Determine which processing steps to execute based on record properties
Operator Categories
Clinia’s operators fall into several categories based on their purpose:Category | Purpose | Operators | Use Cases |
---|---|---|---|
Comparison | Test numerical, date or code value relationships | eq , lt , gt | Status checks, date ranges, numerical thresholds |
Collection | Work with arrays and multiple values | any , all | Multi-select filters, requirement validation |
Text Search | Handle textual content with various matching strategies | match | Full-text search, content filtering |
Semantic | Enable AI-powered similarity matching | knn | Content recommendations, semantic search |
Spatial | Support location-based filtering | geoDistance | Proximity searches, geographic boundaries |
Logical | Combine multiple conditions | and , or , not | Complex filtering logic, condition composition |
Composite | Apply conditions within nested data structures | composite | Related data queries, nested filtering |
Comparison Operators
Equal (eq
)
Tests if a property has the same value or some equivalence. Supports case-insensitive matching for symbol types and wildcard matching.
Supported Data Types: Text Types, Temporal Types, Integer, Decimal, Boolean, Geographic Types
The wildcard
*
tag is a powerful tool for matching any value, including empty strings. It can be used to check if a field exists or to match any value that starts with a specific prefix.Less Than (lt
)
Tests if a property has a value lower than the specified value. Only works with comparable data types.
Supported Data Types: Text Types (symbol
, code
, markdown
), Temporal Types (date
, datetime
, time
, instant
), Numeric Types (integer
, decimal
)
Greater Than (gt
)
Tests if a property has a value greater than the specified value. Only works with comparable data types.
Supported Data Types: Text Types (symbol
, code
, markdown
), Temporal Types (date
, datetime
, time
, instant
), Numeric Types (integer
, decimal
)
Collection Operators
Any (any
)
Tests if a property contains any of the given values. Uses equality (eq
) operator for each value.
Supported Data Types: Text Types, Temporal Types, Integer, Decimal, Boolean, Geographic Types, Array Types
The
any
operator is inclusive and will return true if any of the specified values are found within the property. This means that if the property is an array, it will check each element for a match. The any
operator therefore checks for partial intersection for array datatypes.All (all
)
Tests if an enumerable property contains all of the given values. Uses equality comparison for each value.
Supported Data Types: Text Types, Temporal Types, Integer, Decimal, Boolean, Geographic Types, Array Types
Contrary to the
any
operator, the all
operator checks for complete intersection for array datatypes.Text Search Operators
Match (match
)
Performs full-text matching on symbol data types with multiple matching strategies and optional fuzziness. Useful for flexible text-based filtering across search, validation, and processing scenarios.
Supported Data Types: Text Types (symbol
)
word
: Matches text that contain the query (order independent)wordPrefix
: Matches text that start with the query (order independent)phrase
: Matches text in the exact order specifiedphrasePrefix
: Matches text in order with the last word as a prefix
Semantic Operators
KNN (knn
)
Performs k-nearest neighbor matching using vector embeddings for semantic similarity. Essential for AI-powered content matching, recommendation systems, and intelligent record selection.
Supported Data Types: Vector fields (created by vectorizer processors)
You do not have to specify model at query time. The system will automatically use the model associated with the enriched vector field, ensuring semantic consistency.
Spatial Operators
Geo Distance (geoDistance
)
Tests if a geopoint lies within a specified radius, in meters, from a given location. Supports both coordinate objects and string representations.
Supported Data Types: Geographic Types (geopoint
)
Logical Operators
And (and
)
Combines multiple operators where all conditions must be true. Acts as a logical AND junction.
Or (or
)
Combines multiple operators where at least one condition must be true. Acts as a logical OR junction.
Not (not
)
Negates another operator, returning records that do NOT match the specified condition.
Composite Operators
Composite (composite
)
Applies multiple operators within a specific nested data structure or traversed property path. Essential for querying related data without joins.
Platform Integration Examples
Data Partition API - Record Filtering
Using operators to filter records in data partition queries:Registry API - Field Validation
Defining validation rules for data fields:Registry API - Ingestion Pipeline Conditions
Applying conditional logic in data processing pipelines:TODO: add example