Class YMKSearchSession

Interface denoting ongoing search session.

Allows search cancellation and retry. For many request types allows further searches.

Instance Methods

- cancel

Cancels the current request.

- fetchNextPageWithResponseHandler:

Request the next page of search results.

- hasNextPage

Check the availability of the next result page.

- resubmitWithResponseHandler:

Redo the last search with currently set values of search area, search options, filters, sort type and sort origin.

- retryWithResponseHandler:

Retries the last request.

- setFiltersWithFilters:

Set or clear filters for future resubmits; Full filter set is available in the first search response.

- setSearchAreaWithArea:

Sets the search area for future resubmits.

- setSearchOptionsWithSearchOptions:

Set searchOptions for future resubmits.

- setSortByDistanceWithOrigin:

Requests sorting by distance for future resubmits.

- setSortByRank

Requests sorting by rank for future resubmits.

Method Detail

-cancel

- (void)cancel

Cancels the current request.

-fetchNextPageWithResponseHandler:

- (void)fetchNextPageWithResponseHandler:(nonnull YMKSearchSessionResponseHandler)responseHandler 

Request the next page of search results.

Ignored if the current request isn't ready. Will throw if called when hasNextPage is false.
Parameters:
searchListener

Listener to handle search result.

-hasNextPage

- (BOOL)hasNextPage

Check the availability of the next result page.

Returns:

True if there are more search results and one can call fetchNextPageWithResponseHandler:, false otherwise.

-resubmitWithResponseHandler:

- (void)resubmitWithResponseHandler:(nonnull YMKSearchSessionResponseHandler)responseHandler 

Redo the last search with currently set values of search area, search options, filters, sort type and sort origin.

Isn't applicable to reverse geosearch and URI resolving. Ignored it the current request is the first one; cancels current request otherwise.
Parameters:
searchListener

Listener to handle search result.

-retryWithResponseHandler:

- (void)retryWithResponseHandler:(nonnull YMKSearchSessionResponseHandler)responseHandler 

Retries the last request.

If there is an active request, it is cancelled.
Parameters:
searchListener

Listener to handle search result.

-setFiltersWithFilters:

- (void)setFiltersWithFilters:(nonnull NSArray< YMKSearchBusinessFilter * > *)filters 

Set or clear filters for future resubmits; Full filter set is available in the first search response.

Parameters:
filters

Filter set for future resubmits.

-setSearchAreaWithArea:

- (void)setSearchAreaWithArea:(nonnull YMKGeometry *)area 

Sets the search area for future resubmits.

Supported geometry types: bounding box, polyline, polygon. Polygon is expected to be a search window: 4 points in outer ring (or 5 if last point is equal to first) and no inner rings.
Parameters:
area

Search area for future resubmits.

-setSearchOptionsWithSearchOptions:

- (void)setSearchOptionsWithSearchOptions:(nonnull YMKSearchOptions *)searchOptions 

Set searchOptions for future resubmits.

Parameters:
searchOptions

Additional search parameters, see YMKSearchOptions. Supported options: YMKSearchOptions::origin, YMKSearchOptions::userPosition.

-setSortByDistanceWithOrigin:

- (void)setSortByDistanceWithOrigin:(nonnull YMKGeometry *)origin 

Requests sorting by distance for future resubmits.

Supported geometry types: point- polyline. Mutually exclusive with setSortByRank.
Parameters:
origin

Origin to sort by distance from.

-setSortByRank

- (void)setSortByRank

Requests sorting by rank for future resubmits.

Mutually exclusive with setSortByDistanceWithOrigin:.