SearchExpression

open class SearchExpression : ObjectBase

Represents a parsed OData search expression.

See also

SearchTerm.
  • Operator code for not operator.

    Declaration

    Swift

    public static let operatorNot: Int
  • Operator code for and operator.

    Declaration

    Swift

    public static let operatorAnd: Int
  • Operator code for or operator.

    Declaration

    Swift

    public static let operatorOr: Int
  • Default initializer.

    Declaration

    Swift

    override public init()
  • Search operator, or zero if isTerm is true.

    Declaration

    Swift

    @inline(__always)
    open var `operator`: Int { get }
  • Declaration

    Swift

    open func and(_ other: SearchExpression) -> SearchExpression

    Parameters

    other

    Other search expression.

    Return Value

    The and combination of this search expression with another search expression.

  • Is this search term empty, so it will match any words?

    Declaration

    Swift

    open var isEmpty: Bool { get }
  • Is this search term non-empty, so it will match any words?

    Declaration

    Swift

    open var isNotEmpty: Bool { get }
  • True if this search expression is a SearchTerm where SearchTerm.isPhrase is true.

    Declaration

    Swift

    open var isPhrase: Bool { get }
  • True if this search expression is a SearchTerm.

    Declaration

    Swift

    open var isTerm: Bool { get }
  • True if this search expression is a SearchTerm where SearchTerm.isWord is true.

    Declaration

    Swift

    open var isWord: Bool { get }
  • Declaration

    Swift

    open func matches(words: StringList) -> Bool

    Parameters

    words

    Words to be matched with this search expression.

    Return Value

    True if this search expression matches a specified list of words. Equivalent to matchesWithOptions(words, SearchOptions.none).

  • Declaration

    Swift

    open func matchesWithOptions(words: StringList, options: SearchOptions) -> Bool

    Parameters

    words

    Words to be matched with this search expression.

    options

    Search options.

    Return Value

    True if this search expression matches a specified list of words.

  • Declaration

    Swift

    open func not() -> SearchExpression

    Return Value

    The negation of this search expression.

  • Search operands (immutable list), or empty if isTerm is true.

    Declaration

    Swift

    open var operands: SearchExpressionList { get }
  • Declaration

    Swift

    open func or(_ other: SearchExpression) -> SearchExpression

    Parameters

    other

    Other search expression.

    Return Value

    The or combination of this search expression with another search expression.

  • Declaration

    Swift

    open func urlString() -> String

    Return Value

    This search expression in OData URL format.

  • See also

    constants.

    Declaration

    Swift

    open class func with(operator: Int, operands: SearchExpressionList) -> SearchExpression

    Parameters

    operator

    Search condition operator.

    operands

    Search condition operands (search expressions).

    Return Value

    A search condition using one of: not, and, or.

  • Search words, or empty if isTerm is false.

    Declaration

    Swift

    open var words: StringList { get }
  • Declaration

    Swift

    open class func wordsInText(_ text: String) -> StringList

    Parameters

    text

    Text with one or more space-separated words.

    Return Value

    The separate words in ‘text’, suitable as the ‘words’ parameter of matches.