public class PlacesQuery extends AbstractQuery
Search parameters for Algolia Places.
| Modifier and Type | Class and Description |
|---|---|
static class |
PlacesQuery.Type
Types of places that can be searched for.
|
AbstractQuery.LatLng| Modifier and Type | Field and Description |
|---|---|
static int |
RADIUS_ALL |
| Constructor and Description |
|---|
PlacesQuery()
Construct an empty query.
|
PlacesQuery(PlacesQuery other)
Clone an existing query.
|
PlacesQuery(String query)
Construct a query with the specified full text query.
|
| Modifier and Type | Method and Description |
|---|---|
AbstractQuery.LatLng |
getAroundLatLng() |
Boolean |
getAroundLatLngViaIP() |
Integer |
getAroundRadius()
Get the current radius for around latitude/longitude queries.
|
String[] |
getCountries() |
String |
getHighlightPostTag() |
String |
getHighlightPreTag() |
Integer |
getHitsPerPage() |
String |
getLanguage() |
String |
getQuery() |
PlacesQuery.Type |
getType() |
PlacesQuery |
set(String name,
Object value)
Set a parameter in an untyped fashion.
|
PlacesQuery |
setAroundLatLng(AbstractQuery.LatLng location)
Force to first search around a specific latitude/longitude.
|
PlacesQuery |
setAroundLatLngViaIP(Boolean enabled)
Search first around the geolocation of the user found via his IP address.
|
PlacesQuery |
setAroundRadius(Integer radius)
Change the radius for around latitude/longitude queries.
|
PlacesQuery |
setCountries(String... countries)
Restrict the search results to a specific list of countries.
|
PlacesQuery |
setHighlightPostTag(String tag) |
PlacesQuery |
setHighlightPreTag(String tag) |
PlacesQuery |
setHitsPerPage(Integer nbHitsPerPage)
Set how many results you want to retrieve per search.
|
PlacesQuery |
setLanguage(String language)
Restrict the search results to a single language.
|
PlacesQuery |
setQuery(String query)
Set the full text query.
|
PlacesQuery |
setType(PlacesQuery.Type type)
Set the type of place to search for.
|
build, equals, get, hashCode, parseLatLng, toStringpublic static final int RADIUS_ALL
public PlacesQuery()
Construct an empty query.
public PlacesQuery(String query)
Construct a query with the specified full text query.
query - Full text query.public PlacesQuery(@NonNull
PlacesQuery other)
Clone an existing query.
other - The query to be cloned.@NonNull public PlacesQuery setQuery(String query)
Set the full text query.
public String getQuery()
@NonNull public PlacesQuery setAroundLatLng(AbstractQuery.LatLng location)
Force to first search around a specific latitude/longitude. The default is to search around the location of the user determined via his IP address (geoip).
location - The location to start the search at, or null to use the default.public AbstractQuery.LatLng getAroundLatLng()
@NonNull public PlacesQuery setAroundLatLngViaIP(Boolean enabled)
Search first around the geolocation of the user found via his IP address. Default: true.
enabled - Whether to use IP address to determine geolocation, or null to use the default.public Boolean getAroundLatLngViaIP()
@NonNull public PlacesQuery setAroundRadius(Integer radius)
Change the radius for around latitude/longitude queries.
radius - The radius to set, or RADIUS_ALL to disable stopping at a specific radius, or null to use the default.public Integer getAroundRadius()
Get the current radius for around latitude/longitude queries.
@NonNull public PlacesQuery setHighlightPostTag(String tag)
public String getHighlightPostTag()
@NonNull public PlacesQuery setHighlightPreTag(String tag)
public String getHighlightPreTag()
@NonNull public PlacesQuery setHitsPerPage(Integer nbHitsPerPage)
Set how many results you want to retrieve per search. Default: 20.
public Integer getHitsPerPage()
@NonNull public PlacesQuery setType(PlacesQuery.Type type)
Set the type of place to search for.
type - Type of place to search for.public PlacesQuery.Type getType()
@NonNull public PlacesQuery setLanguage(String language)
Restrict the search results to a single language. You can pass two letters country codes (ISO 639-1).
language - The language used to return the results, or null to use all available languages.public String getLanguage()
@NonNull public PlacesQuery setCountries(String... countries)
Restrict the search results to a specific list of countries. You can pass two letters country codes (ISO 3166-1). Default: Search on the whole planet.
countries - The countries to restrict the search to, or null to search on the whole planet.public String[] getCountries()
@NonNull public PlacesQuery set(@NonNull String name, @Nullable Object value)
Set a parameter in an untyped fashion. This low-level accessor is intended to access parameters that this client does not yet support.
set in class AbstractQueryname - The parameter’s name.value - The parameter’s value, or null to remove it. It will first be converted to a String by the toString() method.