Package com.azure.maps.search.models
Class BaseSearchOptions
java.lang.Object
com.azure.maps.search.models.BaseSearchOptions
Class holding optional parameters for Search.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the address line associated with the search options.Retrieves the first-level administrative district (e.g., a state or province) for the search options.Retrieves the secondary administrative district for the search options.Retrieves the third-level administrative district for the search query.Optional<com.azure.core.models.GeoBoundingBox> Retrieves the geographical bounding box defined for the search.com.azure.core.models.GeoPositionRetrieves the geographic coordinates (latitude and longitude) used for location-based search relevance.Retrieves the country or region code used to filter search results.Retrieves the locality or city specified in the search options.Retrieves the postal code used in the search query.getQuery()Retrieves the query string representing a location, such as an address or landmark.getTop()Retrieves the maximum number of search responses allowed.getView()Retrieves the region-specific view parameter that affects geopolitical labeling.setAddressLine(String addressLine) Sets the street address line for a more specific location in the search query.setAdminDistrict(String adminDistrict) Sets the first-level administrative district to refine the search query.setAdminDistrict2(String adminDistrict2) Sets the secondary administrative district to refine the search query.setAdminDistrict3(String adminDistrict3) Sets the third-level administrative district to refine the search.setBoundingBox(com.azure.core.models.GeoBoundingBox boundingBox) Sets a rectangular geographical area for focusing the search within defined boundaries.setCoordinates(com.azure.core.models.GeoPosition coordinates) Sets the geographic coordinates to enhance the relevance of search results based on location.setCountryRegion(String countryRegion) Sets the country or region code to narrow down the search results.setLocality(String locality) Sets the locality or city to narrow the search results to a specific area.setPostalCode(String postalCode) Sets the postal code for a more targeted search result.Sets the query string used to specify a location for the search request.Sets the maximum number of responses that will be returned for a search query, enabling control over the response size.Sets the view parameter to align geopolitical borders and labels with a specific region.
-
Constructor Details
-
BaseSearchOptions
public BaseSearchOptions()Creates a new instance ofBaseSearchOptions.
-
-
Method Details
-
setTop
Sets the maximum number of responses that will be returned for a search query, enabling control over the response size.- Parameters:
top- Maximum number of responses that will be returned. Default: 5, minimum: 1 and maximum: 20.- Returns:
BaseSearchOptions
-
getQuery
Retrieves the query string representing a location, such as an address or landmark.- Returns:
- query
-
setQuery
Sets the query string used to specify a location for the search request.- Parameters:
query- A string that contains information about a location, such as an address or landmark name.- Returns:
BaseSearchOptions
-
getAddressLine
Retrieves the address line associated with the search options.- Returns:
- addressLine
-
setAddressLine
Sets the street address line for a more specific location in the search query.- Parameters:
addressLine- The official street line of an address relative to the area, as specified by the locality, or postalCode, properties. Typical use of this element would be to provide a street address or any official address.- Returns:
BaseSearchOptions
-
getView
Retrieves the region-specific view parameter that affects geopolitical labeling.- Returns:
- view
-
setView
Sets the view parameter to align geopolitical borders and labels with a specific region.- Parameters:
view- A string that represents an [ISO 3166-1 Alpha-2 region/country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). This will alter Geopolitical disputed borders and labels to align with the specified user region. By default, the View parameter is set to “Auto” even if you haven’t defined it in the request.- Returns:
BaseSearchOptions
-
setBoundingBox
Sets a rectangular geographical area for focusing the search within defined boundaries.- Parameters:
boundingBox- A rectangular area on the earth defined as a bounding box object. The sides of the rectangles are defined by longitude and latitude values. When you specify this parameter, the geographical area is taken into account when computing the results of a location query.- Returns:
BaseSearchOptions
-
getCountryRegion
Retrieves the country or region code used to filter search results.- Returns:
- countryRegion
-
setCountryRegion
Sets the country or region code to narrow down the search results.- Parameters:
countryRegion- Signal for the geocoding result to an [ISO 3166-1 Alpha-2 region/country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) that is specified e.g. FR./- Returns:
BaseSearchOptions
-
getAdminDistrict2
Retrieves the secondary administrative district for the search options.- Returns:
- adminDistrict2
-
setAdminDistrict2
Sets the secondary administrative district to refine the search query.- Parameters:
adminDistrict2- The county for the structured address, such as King.- Returns:
BaseSearchOptions
-
getLocality
Retrieves the locality or city specified in the search options.- Returns:
- locality
-
setLocality
Sets the locality or city to narrow the search results to a specific area.- Parameters:
locality- The locality portion of an address, such as Seattle.- Returns:
BaseSearchOptions
-
getPostalCode
Retrieves the postal code used in the search query.- Returns:
- postalCode
-
setPostalCode
Sets the postal code for a more targeted search result.- Parameters:
postalCode- The postal code portion of an address.- Returns:
BaseSearchOptions
-
getAdminDistrict3
Retrieves the third-level administrative district for the search query.- Returns:
- adminDistrict3
-
setAdminDistrict3
Sets the third-level administrative district to refine the search.- Parameters:
adminDistrict3- The named area for the structured address.- Returns:
BaseSearchOptions
-
getAdminDistrict
Retrieves the first-level administrative district (e.g., a state or province) for the search options.- Returns:
- adminDistrict
-
setAdminDistrict
Sets the first-level administrative district to refine the search query.- Parameters:
adminDistrict- The country subdivision portion of an address, such as WA.- Returns:
BaseSearchOptions
-
getCoordinates
public com.azure.core.models.GeoPosition getCoordinates()Retrieves the geographic coordinates (latitude and longitude) used for location-based search relevance.- Returns:
- coordinates
-
setCoordinates
Sets the geographic coordinates to enhance the relevance of search results based on location.- Parameters:
coordinates- A point on the earth specified as a longitude and latitude. When you specify this parameter, the user’s location is taken into account and the results returned may be more relevant to the user. Example: &coordinates=lon,lat.- Returns:
BaseSearchOptions
-
getTop
Retrieves the maximum number of search responses allowed. Returns the top value.- Returns:
- the top value.
-
getBoundingBox
Retrieves the geographical bounding box defined for the search. Returns the GeoBoundingBox.- Returns:
- GeoBoundingBox
-