Warning

This feature is available in the Full MapKit SDK version

MMKSearchOptions

@interface MMKSearchOptions : NSObject

Struct to fine-tune search request.

Summary

Class methods

+ (nonnull MMKSearchOptions *)searchOptionsWithSearchTypes:( MMKSearchType)searchTypes
                                            resultPageSize:(nullable NSNumber *)resultPageSize
                                                  snippets:( MMKSearchSnippet)snippets
                                              userPosition:(nullable MMKPoint *)userPosition
                                                    origin:(nullable NSString *)origin
                                                  geometry:( BOOL)geometry
                                 disableSpellingCorrection:( BOOL)disableSpellingCorrection
                                                   filters:(nullable MMKSearchFilterCollection *)filters;

Instance methods

- (nonnull MMKSearchOptions *)init;

Properties

@property (nonatomic, assign, unsafe_unretained, readwrite)
    MMKSearchType searchTypes;

The search type can be one of the MMKSearchType values or their bitwise 'OR' combination

@property (nonatomic, copy, readwrite, nullable) NSNumber *resultPageSize;
Maximum number of search results per page

@property (nonatomic, assign, unsafe_unretained, readwrite)
    MMKSearchSnippet snippets;

Snippets that will be requested

@property (nonatomic, strong, readwrite, nullable) MMKPoint *userPosition;
The server uses the user position to calculate the distance from the user to search results

@property (nonatomic, copy, readwrite, nullable) NSString *origin;
String that sets an identifier for the request source

@property (nonatomic, assign, unsafe_unretained, readwrite) BOOL geometry;
Adds the geometry to the server response

@property (nonatomic, assign, unsafe_unretained, readwrite)
    BOOL disableSpellingCorrection;

Force disable correction of spelling mistakes

@property (nonatomic, strong, readwrite, nullable)
    MMKSearchFilterCollection *filters;

Filter set that will be requested

Class methods

searchOptionsWithSearchTypes:resultPageSize:snippets:userPosition:origin:geometry:disableSpellingCorrection:filters:

+ (nonnull MMKSearchOptions *)searchOptionsWithSearchTypes:( MMKSearchType)searchTypes
                                            resultPageSize:(nullable NSNumber *)resultPageSize
                                                  snippets:( MMKSearchSnippet)snippets
                                              userPosition:(nullable MMKPoint *)userPosition
                                                    origin:(nullable NSString *)origin
                                                  geometry:( BOOL)geometry
                                 disableSpellingCorrection:( BOOL)disableSpellingCorrection
                                                   filters:(nullable MMKSearchFilterCollection *)filters;


Instance methods

init

- (nonnull MMKSearchOptions *)init;


Properties

searchTypes

@property (nonatomic, assign, unsafe_unretained, readwrite)
    MMKSearchType searchTypes;

The search type can be one of the MMKSearchType values or their bitwise 'OR' combination. If searchType is not initialized, it means to search in all the sources.


resultPageSize

@property (nonatomic, copy, readwrite, nullable) NSNumber *resultPageSize;

Maximum number of search results per page.

Optional field, can be nil.


snippets

@property (nonatomic, assign, unsafe_unretained, readwrite)
    MMKSearchSnippet snippets;

Snippets that will be requested. The value should be one of MMKSearchSnippet, or their bitwise 'OR' combination.


userPosition

@property (nonatomic, strong, readwrite, nullable) MMKPoint *userPosition;

The server uses the user position to calculate the distance from the user to search results.

Optional field, can be nil.


origin

@property (nonatomic, copy, readwrite, nullable) NSString *origin;

String that sets an identifier for the request source.

Optional field, can be nil.


geometry

@property (nonatomic, assign, unsafe_unretained, readwrite) BOOL geometry;

Adds the geometry to the server response.


disableSpellingCorrection

@property (nonatomic, assign, unsafe_unretained, readwrite)
    BOOL disableSpellingCorrection;

Force disable correction of spelling mistakes.


filters

@property (nonatomic, strong, readwrite, nullable)
    MMKSearchFilterCollection *filters;

Filter set that will be requested. Please note that the full set of filters that can be applied can only be obtained after the primary request. If you pass an invalid filter to the primary request (for example, "pharmacy with swimming pool"), the behavior is undefined. That is the search can either ignore an invalid filter or return an empty response.

Optional field, can be nil.