Click or drag to resize
OSIsoft, LLC

AFSearchOperator Enumeration

Search operator for AFSearch based searches, AFAttributeValueQuery, and AFDurationQuery.

Namespace:  OSIsoft.AF.Search
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 2.10.8.440
Syntax
public enum AFSearchOperator
Members
  Member nameValueDescription
Equal0 For an AFSearch based query, the filter value is equal to the specified Value. For an AFAttributeValueQuery, the attribute value is equal to the specified AFAttributeValueQuery.AttributeValue. For an AFDurationQuery, the event frame's duration is equal to the specified AFDurationQuery.Duration.
NotEqual1 For an AFSearch based query, the filter value is not equal to the specified Value. For an AFAttributeValueQuery, the attribute value is not equal to the specified AFAttributeValueQuery.AttributeValue. For an AFDurationQuery, the event frame's duration is not equal to the specified AFDurationQuery.Duration.
LessThan2 For an AFSearch based query, the filter value is less than to the specified Value. For an AFAttributeValueQuery, the attribute value is less than to the specified AFAttributeValueQuery.AttributeValue. For an AFDurationQuery, the event frame's duration is less than to the specified AFDurationQuery.Duration.
GreaterThan3 For an AFSearch based query, the filter value is greater than to the specified Value. For an AFAttributeValueQuery, the attribute value is greater than to the specified AFAttributeValueQuery.AttributeValue. For an AFDurationQuery, the event frame's duration is greater than to the specified AFDurationQuery.Duration.
LessThanOrEqual4 For an AFSearch based query, the filter value is less than or equal to the specified Value. For an AFAttributeValueQuery, the attribute value is less than or equal to the specified AFAttributeValueQuery.AttributeValue. For an AFDurationQuery, the event frame's duration is less than or equal to the specified AFDurationQuery.Duration.
GreaterThanOrEqual5 For an AFSearch based query, the filter value is greater than or equal to the specified Value. For an AFAttributeValueQuery, the attribute value is greater than or equal to the specified AFAttributeValueQuery.AttributeValue. For an AFDurationQuery, the event frame's duration is greater than or equal to the specified AFDurationQuery.Duration.
In8 For an AFSearch based query, the filter value is IN the array of values specified in the Values. For an AFAttributeValueQuery, the attribute value is IN the array of values specified in the AFAttributeValueQuery.AttributeValue. For an AFDurationQuery, this operation is not valid.
Remarks

This is the operator used to build search tokens for the AFSearch based queries. It is also used to build queries for the AFAttributeValueQuery and AFDurationQuery structures. The value being compared must be a single value for all operators except the In operator. The In operator requires an Array of values.

The Equal and NotEqual operators will perform an exact match if there are no wildcard characters specified. When using wildcard characters with the Equal or NotEqual operators with an AFAttributeValueQuery, the AFAttributeValueQuery.AttributeValue contains the query string (or match pattern).

The string value of a filter can be enclosed in single quotes ('), double quotes ("), or without quotes. The filter string value can include regular characters and wildcard characters. Regular characters must match exactly the characters specified in the filter value. Wildcard characters can be matched with arbitrary fragments of the filter value. Wildcard characters can be escaped using the single backslash (\) character.

When the filter value is specified within either single or double quotes, the single backslash (\) character is treated as a literal character unless followed by a wildcard character, a single quote ('), or a double quote ("). When specified within quotes, two quote characters that match the starting quote character are treated as a single quote character (e.g. '' is treated as a one single quote character ' if the filter value starts with a single quote). When the filter value is specified without quotes, the backslash character is always used to escape the next character. Therefore you must use a double backslash (\\) to match a single backslash when not using quotes around the filter value.

The wildcard characters used in the string value of a filter have the following rules:

  • If an empty string is specified as part of a Name search filter, then everything will be matched. Otherwise, an exact match on empty string or default value for the filter is performed if an empty string is specified.
  • If no wildcards, then an exact match on the query string is performed.
  • Wildcard * can be placed anywhere in the query string and matches zero or more characters.
  • Wildcard ? can be placed anywhere in the query string and matches exactly one character.
  • One character in a set of characters are matched by placing them within [ ]. For example, a[bc] would match 'ab' or 'ac', but it would not match 'ad' or 'abd'.
  • One character in a set of characters are not matched by placing them within [! ]. For example, a[!bc] would match 'ad', but it would not match 'ab', 'ac', or 'abd'.
  • A character in a range of characters from first to last are matched using the following syntax: [first - last]. For example, a[a-c] would match 'aa', 'ab', or 'ac', but it would not match 'ad' or 'abc'.

When building an AFDurationQuery, the In operator is not allowed. The In operator also does not allow wildcard characters in the query string.

Version Information

AFSDK

Supported in: 2.10.5, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6, 2.5, 2.4
See Also
Enabling Operational Intelligence