Relations Filtering
Learn about filtering relations
Format
When a filter parameter is supported in an operation (e.g., relation search), it enables filtering relations by a condition.
filter=({Condition Type}[AND/OR
{Condition Type}]*)
filter={Condition Type}(property, value)
condition, the
search engine considers only the first 256 symbols of the entered value and
ignores the rest.Filter | Description of Condition Types | Example |
---|---|---|
equals | equals(property, value) : This condition type
filters relationships based on the exact match condition by ignoring
the case of the conditional values. This condition type is used in
the Search relation events with cursor operation. | Examples:
Examples for the Search relation events with cursor operation:
|
equalsCaseSensitive | equalsCaseSensitive(property, value) : This
condition type filters relationships based on the exact match
condition by considering the case of the conditional values. | Filter by the Commenters attribute with the
value as ‘John’ (case sensitive):
filter=equalsCaseSensitive(attributes.Commenters,
‘John’) |
containsWordStartingWith |
containsWordStartingWith(property, tokenized
value) : This is a prefixed condition type and returns
relationships that have the conditional property starting with the
conditional value. | Filter by the Title attribute containing a word
starting with ‘Present’:
filter=containsWordStartingWith(attributes.Title,
Present ) |
startsWith |
startsWith(property, stricted value) : This is a
prefixed condition type and returns relationships that have the
condition property starting with the conditional value. | Filter by the Commenters attribute starting with
‘Pitt’: filter=startsWith(attributes.Commenters,
'Pitt') |
fullText |
fullText(property, value) : This condition type
combines individual results into the overall result and returns
relationships that have the conditional property with the
conditional value (any place). | Full text search across all the Commenters
attributes: filter=fullText(attributes.Commenters,
'Mike') |
fuzzy | fuzzy(property, value) : This condition type
filters relations based on the fuzzy match condition. The condition
permits minor differences between the query and target strings.
Fuzzy search logic can be applied to any string attribute Search.
For more information, see Fuzzy Filtering. | Filter by Details for name
Smith:
|
missing |
missing(property) : This condition type returns
relationships with fields that have no values for
property or the property value
is empty. | Filter relationships that do not have the Title
attribute or have empty value for this attribute:
filter=missing(attributes.Title) |
exists |
exist(property) : This condition type returns
relationships having non-empty value for
property . | Filter relationships that have non-empty value for the
Title attribute:
filter=exists(attributes.Title) |
range |
range(property, start, end) : This condition type
indicates that the property is between (including edges, ignoring
case) the specified start and end values. | Filter relationships with Rank between '1' and
'5': filter=range(attributes.Rank, 1, 5) |
lte | lte(property, value) : This condition type
indicates the lesser than or
equals conditions. | Examples:
|
gte | gte(property, value) : This condition type
indicates the greater than or
equals conditions. | Examples:
|
lt |
lt(property, value) : This condition type indicates
the lesser than condition. | Examples:
|
gt |
gt(property, value) : This condition type indicates
the greater than condition. | Examples:
|
contains | contains(property, *value or ?value) : This
condition type is passed if property satisfies a
wildcard record. The supported wildcards are as follows:
| Filter by a specific attribute:
filter=contains(attributes.Commenters,
'*Johnson*')
|
in | in(property, value) : The value
must contain a comma-separated value for the in
filter clause. | Filter relationships with Commenters Janaki or
Titilayo: filter=in(attributes.Commenters,
"Janaki,Titilayo")
|
listEquals | This condition type has the following variants:
Note: The case of the values is not considered when filtering
using any of the variants. Therefore, filtering for both these
variants is not case sensitive. | Example of the two variants:
|
listEqualsCaseSensitive | This condition type has the following variants:
Note: The case of the values is considered when filtering using
any of the variants. Therefore, filtering for both these
variants is case sensitive. | Example of the two variants:
|
not | This operator negates a condition and can be used with other operators. | Filter all entities with the Title attribute
that does not start with New :
filter=not(startsWith(attributes.Title,
'New')) |
- In a condition type expression, property is a dot-delimited path to the
property to be searched with. For example:
type
,attributes.Title
,startObject
.- For the "Search relation events with cursor" operation, available
fields and values for search:
timestamp
,type
,relation_uri
Type
can have the following values:C
(created),U
(updated),D
(deleted).
- For the "Search relation events with cursor" operation, available
fields and values for search:
- Search by multiple conditions is supported with the
AND
andOR
operands. Following are some examples:- Find active relationships by '2005-10-17':
filter=(gt(activeness.startDate, 1129507200) and lt(activeness.endDate,1129507200)
- Filtering relationship events by event timestamp:
filter=(gt(timestamp, 1373288685810) and lt(timestamp,1373288903390))
- Find active relationships by '2005-10-17':
- Search is not case sensitive except for the
equalsCaseSensitive
andlistEqualsCaseSensitive
conditions.
Search for Pinned or Ignored Relation attributes
Use the equals
or missing
filters to find Pinned
or Ignored
relation attributes.
- Any relation attribute is
Pinned
orIgnored
- Case 1 - A defined relation attribute is
Pinned
orIgnored
- Case 2
- Case 1 - Search for any relation attribute
- Example - search for all relations where, at least, one relation attribute is
Pinned
.equals(attributes.pinned, "true")
Note: You can only use this filter with value="true", as in the example above. You'll get a bad request error for value="false". E.g.,equals(attributes.pinned, "false")
.
- Case 2 - Search for a defined relation attribute
- Example - search for all relations where the simple relation attribute,
Name
, ispinned
.
Example - search for all relations where simple relation attributeequals(attributes.Name.pinned, "true")
Summary
, is notIgnored
.
Example - search for all relations where the nested relation attribute,missing(attributes.Summary.ignored)
Identifiers.Type
, isignored
.equals(attributes.Identifiers.Type.ignored, "true")