OSQuery

public class OSQuery

OSQuery is an object that represents a search query. It makes the process of parsing and tokenizing a query without the need for user’s interaction. It currently supports 57 languages (ISO 639-1):

afarhyeubnbrbgcazhhrcsdanleneoetfifrgldeelhahehihuidgaitjakokulaltlvmsmrnofaplptroruskslsostesswsvthtltrukurviyozu

The query object can also specify which column to search in using the keys array. This will mostly be useful in the Quick searches, but it works on all OrionSearch.OSSearchType.

Construction

let query = OSQuery(str: "Articles about Donald Trump")
  • str

    Original string input

    Declaration

    Swift

    public var str: String
  • Specials column to look into

    Declaration

    Swift

    public var keys: [String]?
  • Parsed values

    • Return Values:
      • filters: [[String]]
      • keywords: [String : Double]

    Declaration

    Swift

    public var parsed: [String : Any]
  • OSQuery’s contructor

    Declaration

    Swift

    public init(_ str: String, lang: String = "en", keys: [String]? = nil)

    Parameters

    str

    The query as it was typed by the user

    lang

    In which language was the user’s query written?

    keys

    Special column to look into. Used for Quick searches