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):
af | ar | hy | eu | bn | br | bg | ca | zh | hr | cs | da | nl | en | eo | et | fi | fr | gl | de | el | ha | he | hi | hu | id | ga | it | ja | ko | ku | la | lt | lv | ms | mr | no | fa | pl | pt | ro | ru | sk | sl | so | st | es | sw | sv | th | tl | tr | uk | ur | vi | yo | zu |
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")
-
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]
- filters:
Declaration
Swift
public var parsed: [String : Any]
- Return Values:
-
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