SearchTerm
open class SearchTerm : SearchExpression
Represents an OData search term (word or phrase).
-
An empty search term, that will match any words.
Declaration
Swift
nonisolated(unsafe) public static let empty: SearchTerm -
Search operator, or zero if
isTermistrue.Declaration
Swift
override open var `operator`: Int { get } -
See also
wordif the server doesn’t support adding “*” beforehand and afterwards to enable “contains” matching.Declaration
Swift
open class func contains(_ text: String) -> SearchTermParameters
textText of word(s), or phrase surrounded by double quotes.
Return Value
a new word or phrase term with “*” before and after each word to indicate “contains” matching. Note: some server implementations might not support such “contains” matching. Use only where appropriate.
-
Is this search term empty, so it will match any words?
Declaration
Swift
override open var isEmpty: Bool { get } -
True if this search expression is a
SearchTermwhereSearchTerm.isPhraseis true.Declaration
Swift
override open var isPhrase: Bool { get } -
True if this search expression is a
SearchTerm.Declaration
Swift
override open var isTerm: Bool { get } -
True if this search expression is a
SearchTermwhereSearchTerm.isWordis true.Declaration
Swift
override open var isWord: Bool { get } -
Declaration
Swift
override open func matchesWithOptions(words: StringList, options: SearchOptions) -> BoolParameters
wordsWords to be matched with this search expression.
optionsSearch options.
Return Value
True if this search expression matches a specified list of words.
-
Search operands (immutable list), or empty if
isTermistrue.Declaration
Swift
override open var operands: SearchExpressionList { get } -
Declaration
Swift
open class func phrase(_ words: StringList) -> SearchTermParameters
wordsPhrase words.
Return Value
a new phrase term. For a phrase term,
matchesensures that the words of the phrase occur in sequence. -
See also
wordif the server doesn’t support adding “*” afterwards to enable prefix matching.Declaration
Swift
open class func prefix(_ text: String, limit: Int = (0 as Int)) -> SearchTermParameters
textText of word(s), or phrase surrounded by double quotes.
limitNumber of words to have “*” afterwards. If zero, it applies to all words. If positive, it applies to the first
limitwords. If negative, it applies to the last-limitwords.Return Value
a new word or phrase term with “*” after each word to indicate prefix matching. Note: some server implementations might not support such prefix matching. Use only where appropriate.
-
See also
wordif the server doesn’t support adding “*” beforehand to enable suffix matching.Declaration
Swift
open class func suffix(_ text: String, limit: Int = (0 as Int)) -> SearchTermParameters
textText of word(s), or phrase surrounded by double quotes.
limitNumber of words to have “*” afterwards. If zero, it applies to all words. If positive, it applies to the first
limitwords. If negative, it applies to the last-limitwords.Return Value
a new word or phrase term with “*” before each word to indicate suffix matching. Note: some server implementations might not support such suffix matching. Use only where appropriate.
-
Declaration
Swift
override open func toString() -> StringReturn Value
This search expression in human readable format.
-
Declaration
Swift
override open func urlString() -> StringReturn Value
This search expression in OData URL format.
-
Declaration
Swift
open class func word(_ text: String) -> SearchTermParameters
textWord text.
Return Value
a new word term.
-
Search words, or empty if
isTermisfalse.Declaration
Swift
override open var words: StringList { get }