Class SearchOptions

com.yandex.mapkit.search

java.lang.Object ⇽ SearchOptions

public class SearchOptions

Struct to fine-tune search request.

Constructors

SearchOptions(int searchTypes, _Nullable Integer resultPageSize, int snippets, _NonNull List< String > experimentalSnippets, _Nullable Point userPosition, _Nullable String origin, _Nullable String directPageId, _Nullable String appleCtx, boolean geometry, _Nullable String advertPageId, boolean suggestWords, boolean disableSpellingCorrection)
SearchOptions()

Use constructor with parameters in your code.

Methods

String getAdvertPageId()

The landing page ID for ads.

String getAppleCtx()

The context from an Apple-directed session.

String getDirectPageId()

The landing page ID for Yandex.Direct.

boolean getDisableSpellingCorrection()

Force disable correction of spelling mistakes.

List< String > getExperimentalSnippets()

Experimental snippets that will be requested.

boolean getGeometry()

Adds the geometry to the server response.

String getOrigin()

String that sets an identifier for the request source.

Integer getResultPageSize()

Maximum number of search results per page.

int getSearchTypes()

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

int getSnippets()

Snippets that will be requested.

boolean getSuggestWords()

Enable word-by-word suggestion items.

Point getUserPosition()

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

void serialize(Archive archive)
SearchOptions setAdvertPageId(@Nullable String advertPageId)

See getAdvertPageId().

SearchOptions setAppleCtx(@Nullable String appleCtx)

See getAppleCtx().

SearchOptions setDirectPageId(@Nullable String directPageId)

See getDirectPageId().

SearchOptions setDisableSpellingCorrection(boolean disableSpellingCorrection)

See getDisableSpellingCorrection().

SearchOptions setExperimentalSnippets(@NonNull List< String > experimentalSnippets)

See getExperimentalSnippets().

SearchOptions setGeometry(boolean geometry)

See getGeometry().

SearchOptions setOrigin(@Nullable String origin)

See getOrigin().

SearchOptions setResultPageSize(@Nullable Integer resultPageSize)

See getResultPageSize().

SearchOptions setSearchTypes(int searchTypes)

See getSearchTypes().

SearchOptions setSnippets(int snippets)

See getSnippets().

SearchOptions setSuggestWords(boolean suggestWords)

See getSuggestWords().

SearchOptions setUserPosition(@Nullable Point userPosition)

See getUserPosition().

Constructor Detail

SearchOptions

public SearchOptions (int searchTypes, @Nullable Integer resultPageSize, int snippets, @NonNull List< String > experimentalSnippets, @Nullable Point userPosition, @Nullable String origin, @Nullable String directPageId, @Nullable String appleCtx, boolean geometry, @Nullable String advertPageId, boolean suggestWords, boolean disableSpellingCorrection)

SearchOptions

public SearchOptions ()

Use constructor with parameters in your code.

This one is for bindings only!

Method Detail

getAdvertPageId

public String getAdvertPageId ()

The landing page ID for ads.

Optional field, can be null.

getAppleCtx

public String getAppleCtx ()

The context from an Apple-directed session.

Optional field, can be null.

getDirectPageId

public String getDirectPageId ()

The landing page ID for Yandex.Direct.

Used with 'Direct' SearchType.Optional field, can be null.

getDisableSpellingCorrection

public boolean getDisableSpellingCorrection ()

Force disable correction of spelling mistakes.

getExperimentalSnippets

public List< String > getExperimentalSnippets ()

Experimental snippets that will be requested.

Requested snippets can be found in ExperimentalMetadata.

getGeometry

public boolean getGeometry ()

Adds the geometry to the server response.

getOrigin

public String getOrigin ()

String that sets an identifier for the request source.

Optional field, can be null.

getResultPageSize

public Integer getResultPageSize ()

Maximum number of search results per page.

Optional field, can be null.

getSearchTypes

public int getSearchTypes ()

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

If searchType is not initialized, it means to search in all the sources.

getSnippets

public int getSnippets ()

Snippets that will be requested.

The value should be one of Snippet, or their bitwise 'OR' combination.

getSuggestWords

public boolean getSuggestWords ()

Enable word-by-word suggestion items.

getUserPosition

public Point getUserPosition ()

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

Optional field, can be null.

serialize

public void serialize (Archive archive)

setAdvertPageId

public SearchOptions setAdvertPageId (@Nullable String advertPageId)

See getAdvertPageId().

setAppleCtx

public SearchOptions setAppleCtx (@Nullable String appleCtx)

See getAppleCtx().

setDirectPageId

public SearchOptions setDirectPageId (@Nullable String directPageId)

See getDirectPageId().

setDisableSpellingCorrection

public SearchOptions setDisableSpellingCorrection (boolean disableSpellingCorrection)

See getDisableSpellingCorrection().

setExperimentalSnippets

public SearchOptions setExperimentalSnippets (@NonNull List< String > experimentalSnippets)

See getExperimentalSnippets().

setGeometry

public SearchOptions setGeometry (boolean geometry)

See getGeometry().

setOrigin

public SearchOptions setOrigin (@Nullable String origin)

See getOrigin().

setResultPageSize

public SearchOptions setResultPageSize (@Nullable Integer resultPageSize)

See getResultPageSize().

setSearchTypes

public SearchOptions setSearchTypes (int searchTypes)

See getSearchTypes().

setSnippets

public SearchOptions setSnippets (int snippets)

See getSnippets().

setSuggestWords

public SearchOptions setSuggestWords (boolean suggestWords)

See getSuggestWords().

setUserPosition

public SearchOptions setUserPosition (@Nullable Point userPosition)

See getUserPosition().