SearchByTextRequest

public abstract class SearchByTextRequest extends Object
implements Request

Nested Class Summary

class SearchByTextRequest.Builder Builder for SearchByTextRequest
enum SearchByTextRequest.RankPreference How results will be ranked in the response. 

Public Constructor Summary

Public Method Summary

static SearchByTextRequest.Builder
builder(String textQuery, List<Place.Field> placeFields)
abstract String
getIncludedType()
Returns the requested place type.
abstract LocationBias
getLocationBias()
Returns the biased region to search.
abstract LocationRestriction
getLocationRestriction()
Returns the restricted region to search.
abstract Integer
getMaxResultCount()
Returns the maximum number of results to return.
abstract Double
getMinRating()
Returns the minimum average user rating for places to be included in the results.
abstract List<Place.Field>
getPlaceFields()
Returns the Place.Fields that should be included in the place results.
abstract List<Integer>
getPriceLevels()
Returns the price levels of places that should be included in the results.
abstract SearchByTextRequest.RankPreference
abstract String
getRegionCode()
The unicode country/region code (CLDR) of the location where the request is coming from.
abstract String
getTextQuery()
Returns the text query for the search.
abstract boolean
isOpenNow()
Returns whether results should be restricted to places that are currently open.
abstract boolean
isStrictTypeFiltering()
Returns whether only results of getIncludedType() should be returned.
static SearchByTextRequest
newInstance(String textQuery, List<Place.Field> placeFields)

Inherited Method Summary

Public Constructors

public SearchByTextRequest ()

Public Methods

public static SearchByTextRequest.Builder builder (String textQuery, List<Place.Field> placeFields)

Parameters
textQuery
placeFields

public abstract String getIncludedType ()

Returns the requested place type.

A list of supported types can be found in PlaceTypes.

See new Table A and B for the most up-to-date list of supported types available to PlacesClient.searchByText(SearchByTextRequest).

public abstract LocationBias getLocationBias ()

Returns the biased region to search.

This location serves as a bias, which means there is a preference for results in the given location.

Location restriction and location bias cannot be set at the same time. Only one should be set per request.

If you omit both location bias and location restriction, then the request uses IP biasing by default. With IP biasing, the request uses the device's IP address to bias the results.

public abstract LocationRestriction getLocationRestriction ()

Returns the restricted region to search.

This location serves as a restriction which means results outside the given location will not be returned.

The LocationRestriction for SearchByTextRequest only supports RectangularBounds type.

Location restriction and location bias cannot be set at the same time. Only one should be set per request.

If you omit both location bias and location restriction, then the request uses IP biasing by default. With IP biasing, the request uses the device's IP address to bias the results.

public abstract Integer getMaxResultCount ()

Returns the maximum number of results to return.

public abstract Double getMinRating ()

Returns the minimum average user rating for places to be included in the results.

public abstract List<Place.Field> getPlaceFields ()

Returns the Place.Fields that should be included in the place results.

public abstract List<Integer> getPriceLevels ()

Returns the price levels of places that should be included in the results.

Any combination of price levels can be chosen; default is all price levels.

  • 0 - PRICE_LEVEL_FREE
  • 1 - PRICE_LEVEL_INEXPENSIVE
  • 2 - PRICE_LEVEL_MODERATE
  • 3 - PRICE_LEVEL_EXPENSIVE
  • 4 - PRICE_LEVEL_VERY_EXPENSIVE

public abstract String getRegionCode ()

The unicode country/region code (CLDR) of the location where the request is coming from.

The region may affect the format and type of data returned.

See Territory Containment for region codes.

public abstract String getTextQuery ()

Returns the text query for the search.

public abstract boolean isOpenNow ()

Returns whether results should be restricted to places that are currently open.

public abstract boolean isStrictTypeFiltering ()

Returns whether only results of getIncludedType() should be returned.

Default value is false.

public static SearchByTextRequest newInstance (String textQuery, List<Place.Field> placeFields)

Parameters
textQuery
placeFields