GLSearchFilter

Objective-C


@interface GLSearchFilter : NSObject

Swift

class GLSearchFilter : NSObject

GLSearchFilter class contains a set of parameters that defines filter for GLSearch

  • Unavailable

    Empty filter is not allowed. Please use proper init method.

    Default constructor is disabled.

    Declaration

    Objective-C

    - (instancetype _Nonnull)init;
  • Creates new filter to search objects with string “query”. Uses default tag set and match type. Default tag set is GLSearchTagSetMask_All Default match type is GLSearchMatchType_WordStart

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithQuery:(NSString *_Nonnull)query;

    Swift

    init(query: String)

    Parameters

    query

    Part of word, word or phrase to search

    Return Value

    Filter instance

  • Creates new filter to search objects with string “query” set for tag “tag”. Default match type is GLSearchMatchType_Exact

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithQuery:(NSString *_Nonnull)query
                                       tag:(NSString *_Nonnull)tag;

    Swift

    init(query: String, tag: String)

    Parameters

    query

    Expected value of tag

    tag

    Tag

    Return Value

    Filter instance

  • Creates new filter to search objects with string “query” inside tags sets

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithQuery:(NSString *_Nonnull)query
                                tagSetMask:(GLSearchTagSetMask)tagSetMask;

    Swift

    init(query: String, tagSetMask: GLSearchTagSetMask)

    Parameters

    query

    Part of word, word or phrase to search

    tagSetMask

    Set of tags where query could be found

    Return Value

    Filter instance

  • Creates new filter to search objects from category

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithCategory:(GLSearchCategory *_Nonnull)category;

    Swift

    init(category: GLSearchCategory)

    Parameters

    category

    Category

  • Adds tag using it’s hash Tag hashes could be found in vector object returned from search or found on map

    Declaration

    Objective-C

    - (void)addTagHash:(uint32_t)tagHash;

    Swift

    func addTagHash(_ tagHash: UInt32)

    Parameters

    tagHash

    Hash of the tag

  • Adds tag to search filter

    Declaration

    Objective-C

    - (void)addTag:(NSString *_Nonnull)tag;

    Swift

    func addTag(_ tag: String)

    Parameters

    tag

    Tag

  • Adds additional tags to search filter

    Declaration

    Objective-C

    - (void)addTags:(NSArray<NSString *> *_Nonnull)tags;

    Swift

    func addTags(_ tags: [String])

    Parameters

    tags

    Tags array

  • Sets how we should compare query string with values of objects. Default match type is MatchType.WORD_START

    Declaration

    Objective-C

    @property GLSearchMatchType matchType;

    Swift

    var matchType: GLSearchMatchType { get set }