GLSearchFilter

Objective-C


@interface GLSearchFilter : NSObject

Swift

class GLSearchFilter : NSObject

GLSearchFilter class contains a set of parameters that define a filter for GLSearch.

  • Unavailable

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

    Default -init is disabled.

    Declaration

    Objective-C

    - (instancetype _Nonnull)init;
  • Creates a new filter to search objects with the string “query”. Uses the 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 the word, word, or phrase to search.

    Return Value

    Filter instance.

  • Creates a new filter to search objects with the string “query” set for the 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 the tag.

    tag

    Tag.

    Return Value

    Filter instance.

  • Creates a new filter to search objects with the string “query” inside tag sets.

    Declaration

    Objective-C

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

    Swift

    init(query: String, tagSetMask: GLSearchTagSetMask)

    Parameters

    query

    Part of the word, word, or phrase to search.

    tagSetMask

    Set of tags where the query could be found.

    Return Value

    Filter instance.

  • Creates a new filter to search objects from a category.

    Declaration

    Objective-C

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

    Swift

    init(category: GLSearchCategory)

    Parameters

    category

    Category.

  • Adds a tag using its hash. Tag hashes can be found in vector objects returned from search or found on the map.

    Declaration

    Objective-C

    - (void)addTagHash:(uint32_t)tagHash;

    Swift

    func addTagHash(_ tagHash: UInt32)

    Parameters

    tagHash

    Hash of the tag.

  • Adds a tag to the search filter.

    Declaration

    Objective-C

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

    Swift

    func addTag(_ tag: String)

    Parameters

    tag

    Tag.

  • Adds additional tags to the search filter.

    Declaration

    Objective-C

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

    Swift

    func addTags(_ tags: [String])

    Parameters

    tags

    Tags array.

  • Sets how the query string should be compared with the values of objects. The default match type is GLSearchMatchType_WordStart.

    Declaration

    Objective-C

    @property GLSearchMatchType matchType;

    Swift

    var matchType: GLSearchMatchType { get set }