MessageSearchQuery

@objc(SBDMessageSearchQuery)
public class MessageSearchQuery : NSObject, Codable, Queryable
extension MessageSearchQuery: Serializable

A class representing query to retrieve list of BaseMessages that matches a given query with given filters. MessageSearchQuery can be generated by using MessageSearchQueryBuilder

Since

3.0.162
  • Boolean indicates there are more data to fetch

    Declaration

    Swift

    @objc
    public internal(set) var hasNext: Bool { get }
  • Indicates the query is currently loading or not

    Declaration

    Swift

    @objc
    public internal(set) var isLoading: Bool { get }
  • Indicates the total count of results that match the given search.

    Since

    4.0.10

    Declaration

    Swift

    public internal(set) var totalCount: Int32 { get }
  • Declaration

    Swift

    public required init(from decoder: Decoder) throws
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws
  • Fetches next page

    Declaration

    Swift

    @objc
    public func loadNextPage(completionHandler: @escaping MessageListHandler)

    Parameters

    completionHandler

    completion handler

  • Copies this object

    Declaration

    Swift

    public func copy(with zone: NSZone? = nil) -> Any

    Parameters

    zone

    optional NSZone

    Return Value

    MessageListQuery instance

Serializable

  • Serializes this object into data

    Declaration

    Swift

    public func serialize() -> Data?

    Return Value

    optioanal Data instance

  • Deserializes and reconstructs the object

    Declaration

    Swift

    public class func build(fromSerializedData data: Data?) -> `Self`?

    Parameters

    data

    Data instance

    Return Value

    MessageSearchQuery if parameter is valid, otherwise nil

Params Bridge

  • The maximum number of SBDBaseMessages per queried page. Default is 20, maximum is 999 (<1000)

    Declaration

    Swift

    @objc
    public var limit: UInt { get }
  • Keyword to search for.

    Declaration

    Swift

    @objc
    public var keyword: String? { get }
  • Channel url of the channel you want to set as a scope for the search.

    Declaration

    Swift

    @objc
    public var channelURL: String? { get }
  • Channel custom type you want to set as a scope for the search.

    Declaration

    Swift

    @objc
    public var channelCustomType: String? { get }
  • Should reverse the queried result list. Default is false

    Declaration

    Swift

    @objc
    public var reverse: Bool { get }
  • Should search as a complete, exact phrase. Default is false

    Declaration

    Swift

    @objc
    public var exactMatch: Bool { get }
  • Starting timestamp to search from. Default is 0

    Declaration

    Swift

    @objc
    public var messageTimestampFrom: Int64 { get }
  • Ending timestamp to search to. Default is 0

    Declaration

    Swift

    @objc
    public var messageTimestampTo: Int64 { get }
  • The order method for the search. Default is .score

    Declaration

    Swift

    @objc
    public var order: MessageSearchQueryOrder { get }
  • Whether treat keyword field as advanced query or not

    Since

    3.0.222

    Declaration

    Swift

    @objc
    public var advancedQuery: Bool { get }
  • Array of target fields in message’s data that will be searched with keyword

    Since

    3.0.222

    Declaration

    Swift

    @objc
    public var targetFields: [String]? { get }