Documentation
Reference
2.1.50 (current version)
collection
interactivityModel
Interfaces
2.1.51 (release candidate)
collection
interactivityModel
Interfaces

suggest

Static function.

Processes requests for search suggestions. Returns a promise object that is either rejected with an error, or confirmed by an array of objects in the format { displayName: "Mitishi, Moscow region", value: "Russia, Moscow region, Mitishi " }. The displayName field represents the toponym in a user-friendly way, and the value field represents the value which should be inserted into the search field after the user selects the suggestion.

Returns a Promise object.

{ vow.Promise } suggest(request[, options])

Parameters:

ParameterDefault valueDescription
request*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: String

Request string.

options

Type: Object

Options.

options.boundedBy

Type: Number[][]

A rectangular area on the map, where the object being searched for is presumably located. Must be set as an array, such as [[30, 40], [50, 50]].

options.provider 'yandex#map'

Type: ISuggestProvider|String

Search suggestion provider. You can use the 'yandex#map' built-in search suggestion provider for map objects, or specify your own.

options.results

Type: Number

Maximum number of results to be returned.

* Mandatory parameter/option.

Example:

ymaps.suggest('myt').then(function (items) {
    // items - Array of search suggestions.
});