HERE Android SDK Developer's Guide

TextAutoSuggestionRequest

The class TextAutoSuggestionRequest is a member of com.here.android.mpa.search .

Class Summary

public class TextAutoSuggestionRequest

extends com.here.android.mpa.search.Request, java.lang.Object

Represents an extended Request used to retrieve a List of suggested search terms, instants results and refined search links by way of Places search services.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in TextAutoSuggestionRequest
Nested Classes

public static final enumeration TextAutoSuggestionRequest.AutoSuggestFilterType

Represents values describing AutoSuggest response's result filter types that can be used to filter the AutoSuggest response.

Constructor Summary

Table 2. Constructors in TextAutoSuggestionRequest
Constructors

TextAutoSuggestionRequest (String partialTerm)

Default constructor.

Method Summary

Table 3. Methods in TextAutoSuggestionRequest
Methods

public ErrorCode execute (ResultListener<AutoSuggest> listener)

Executes an asynchronous request.

public int getCollectionSize ()

Gets the current collection size being used for request responses.

public RichTextFormatting getRichTextFormatting ()

Gets the current RichTextFormatting type being used in request responses.

public TextAutoSuggestionRequest setCollectionSize (int value)

Sets a collection size to be used for request responses.

public TextAutoSuggestionRequest setFilters (java.util.EnumSet <AutoSuggestFilterType> filtersSet)

Set result type filter.

public TextAutoSuggestionRequest setMapViewport (GeoBoundingBox mapViewport)

The map viewport is a bounding box of the map area currently visible to the user.

public TextAutoSuggestionRequest setQueryText (String partialTerm)

Set the query partial search term.

public TextAutoSuggestionRequest setRichTextFormatting (RichTextFormatting value)

Sets a RichTextFormatting to be used in request responses.

public TextAutoSuggestionRequest setSearchCenter (GeoCoordinate center)

Sets the search center.

Class Details

Represents an extended Request used to retrieve a List of suggested search terms, instants results and refined search links by way of Places search services.

TextAutoSuggestionRequest supports online only. Please use TextSuggestionRequest for offline.

A search location context must be provided by setting either a search center using setSearchCenter(GeoCoordinate) or a bounding map viewport using Request%3CT%3E#setMapViewport(GeoBoundingBox). Failing to set a map viewport will result in an INVALID_PARAMETER when executing the request.

Constructor Details

TextAutoSuggestionRequest (String partialTerm)

Default constructor.

Creates a request to return a list of suggested search terms, instants results and refined search links that are related to a specified location context and a partial search term.

A search location context must be provided by setting either a search center using setSearchCenter(GeoCoordinate) or a bounding map viewport using Request%3CT%3E#setMapViewport(GeoBoundingBox). Failing to set a map viewport will result in an INVALID_PARAMETER when executing the request.

Parameters:

  • partialTerm

    A partial search term used to create a list of suggested search terms.

Method Details

public ErrorCode execute (ResultListener<AutoSuggest> listener)

Executes an asynchronous request.

Parameters:

  • listener

    A ResultListener passed along with the request to monitor progress

Returns:

The ErrorCode representing an appropriate result

public int getCollectionSize ()

Gets the current collection size being used for request responses.

Returns:

The current response collection size

public RichTextFormatting getRichTextFormatting ()

Gets the current RichTextFormatting type being used in request responses.

Returns:

The current RichTextFormatting type

public TextAutoSuggestionRequest setCollectionSize (int value)

Sets a collection size to be used for request responses. The maximum number of result items in each collection will be limited to this value. The valid value range is [1..100]. The default collection size is 20.

Parameters:

  • value

    Desired response collection size per request.

Returns:

This Request%3CT%3E object

Throws:

  • IllegalArgumentException

    if size is out of range.

public TextAutoSuggestionRequest setFilters (java.util.EnumSet <AutoSuggestFilterType> filtersSet)

Set result type filter.

Parameters:

Returns:

The TextAutoSuggestionRequest.

public TextAutoSuggestionRequest setMapViewport (GeoBoundingBox mapViewport)

The map viewport is a bounding box of the map area currently visible to the user. The viewport can act as an implicit location context in the absence of an explicit location context. To ensure you get the best results possible, you should always set a viewport if there is a map visible to the user.

Parameters:

  • mapViewport

    The bounding box of the map area currently visible.

public TextAutoSuggestionRequest setQueryText (String partialTerm)

Set the query partial search term.

Parameters:

  • partialTerm

    A partial search term used to create a list of suggested search terms.

Returns:

The TextAutoSuggestionRequest.

public TextAutoSuggestionRequest setRichTextFormatting (RichTextFormatting value)

Sets a RichTextFormatting to be used in request responses. The default formatting is HTML.

Parameters:

  • value

    Desired RichTextFormatting

Returns:

This TextAutoSuggestionRequest object

public TextAutoSuggestionRequest setSearchCenter (GeoCoordinate center)

Sets the search center.

Parameters:

  • center

    The GeoCoordinate representing the location context used to search for nearby places.

Returns:

The TextAutoSuggestionRequest.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.