Interface SearchManager

com.yandex.mapkit.search

public interface SearchManager

Main interface to start search.

Methods

SuggestSession createSuggestSession()

Creates session for suggest requests.

GoodsRegisterSession requestGoodsRegister(@NonNull String uri, @NonNull GoodsRegisterListener goodsRegisterListener)

Search request for goods register.

Session resolveURI(@NonNull String uri, @NonNull SearchOptions searchOptions, @NonNull SearchListener searchListener)

Search request for URI resolution.

Session searchByURI(@NonNull String uri, @NonNull SearchOptions searchOptions, @NonNull SearchListener searchListener)

Search request with URI.

Session submit(@NonNull String text, @NonNull Geometry geometry, @NonNull SearchOptions searchOptions, @NonNull SearchListener searchListener)

Search request for searching a user query near given geometry.

Session submit(@NonNull String text, @NonNull Polyline polyline, @NonNull Geometry geometry, @NonNull SearchOptions searchOptions, @NonNull SearchListener searchListener)

Search request that is used to search for a user query along the given polyline inside the given window.

Session submit(@NonNull Point point, @Nullable Integer zoom, @NonNull SearchOptions searchOptions, @NonNull SearchListener searchListener)

Reverse search request (to search objects at the given coordinates)

Method Detail

createSuggestSession

public SuggestSession createSuggestSession ()

Creates session for suggest requests.

requestGoodsRegister

public GoodsRegisterSession requestGoodsRegister (@NonNull String uri, @NonNull GoodsRegisterListener goodsRegisterListener)

Search request for goods register.

Parameters:
uri

Uri of object for which goods register is requested.

goodsRegisterListener

Listener to handle search result.

Returns:

GoodsRegisterSession which allows search cancel and retry. Should be stored by user or search is automatically cancelled.

resolveURI

public Session resolveURI (@NonNull String uri, @NonNull SearchOptions searchOptions, @NonNull SearchListener searchListener)

Search request for URI resolution.

Parameters:
uri

Object uri.

searchOptions

Additional search parameters, see SearchOptions definition for details. Currently the only supported options are SearchOptions#origin and SearchOptions#snippets.

searchListener

Listener to handle search result.

Returns:

Session which allows search cancel and retry. Should be stored by user or search is automatically cancelled.

searchByURI

public Session searchByURI (@NonNull String uri, @NonNull SearchOptions searchOptions, @NonNull SearchListener searchListener)

Search request with URI.

Allows multiple results in response.
Parameters:
uri

Object uri.

searchOptions

Additional search parameters, see SearchOptions definition for details. Currently the only supported options are SearchOptions#origin, SearchOptions#snippets and. SearchOptions#resultPageSize.

searchListener

Listener to handle search result.

Returns:

Session which allows search cancel and retry. Should be stored by user or search is automatically cancelled.

submit

public Session submit (@NonNull String text, @NonNull Geometry geometry, @NonNull SearchOptions searchOptions, @NonNull SearchListener searchListener)

Search request for searching a user query near given geometry.

Parameters:
text

User query.

geometry

Geometry to search near. Supported types: point, bounding box, polyline and polygon. If the polyline is provided, setSortByDistance(polyline) is assumed on the first request. Polygon is expected to be a search window: 4 points in outer ring (or 5 if the last point is equal to the first) and no inner rings.

searchOptions

Various additional search parameters, see SearchOptions definition for details.

searchListener

Listener to handle search result.

Returns:

Session which allows further searches, cancel and retry.

submit

public Session submit (@NonNull String text, @NonNull Polyline polyline, @NonNull Geometry geometry, @NonNull SearchOptions searchOptions, @NonNull SearchListener searchListener)

Search request that is used to search for a user query along the given polyline inside the given window.

Parameters:
text

User query.

polyline

Polyline to search near; Session#setSortByDistance(Geometry) is assumed on the first request.

geometry

Geometry to search near; supported types: point, bounding box, polyline and polygon. Polygon is expected to be a search window: 4 points in outer ring (or 5 if the last point is equal to first) and no inner rings.

searchOptions

Various additional search parameters, see SearchOptions definition for details.

searchListener

Listener to handle search result.

Returns:

Session which allows further searches, cancel and retry. Session should be stored by user or search is automatically cancelled.

submit

public Session submit (@NonNull Point point, @Nullable Integer zoom, @NonNull SearchOptions searchOptions, @NonNull SearchListener searchListener)

Reverse search request (to search objects at the given coordinates)

Parameters:
point

Coordinates to search at.

zoom

Current zoom level. Skips objects that are too small for a given zoom level.

searchOptions

Additional search parameters, see SearchOptions definition for details. Currently the only supported options are SearchOptions#origin, SearchOptions#searchTypes and SearchOptions#snippets. Only 'geo' and 'biz' types are supported and not at the same time.

searchListener

Listener to handle search result.

Returns:

Session which allows further searches, cancel and retry. Session should be stored by user or search is automatically cancelled.

Remark:
Parameters:
zoom

has optional type, it may be uninitialized.