SearchQueryBuilder
Search query builder. The search is performed by the global index, as well as by local indexes of segments, where a segment is a certain piece of the global map partitioning. The procedure for selecting segments for search is performed in the following ways (in the descending order of priority):
Hashable
public static func == (lhs: SearchQueryBuilder, rhs: SearchQueryBuilder) -> Bool
Returns a Boolean value indicating whether two values are equal.
public func hash(into hasher: inout Hasher)
Hashes the essential components of this value by passing them to the given hasher.
hasher
Hasher
Hasher to use when combining the components of this instance.
public static func fromQueryText(
queryText: String
) -> SearchQueryBuilder
Starts building a text search query with the given text.
public static func fromRubricIds(
rubricIds: [RubricId]
) -> SearchQueryBuilder
Starts building a search query based on the rubric identifiers.
public static func fromQueryTextAndRubricIds(
queryText: String,
rubricIds: [RubricId]
) -> SearchQueryBuilder
Starts building a search query based on the rubric identifiers.
public static func fromQuery(
query: SearchQuery
) -> SearchQueryBuilder
Starts building a query based on the #query to change part of the parameters.
The original #query remains unchanged.
public static func fromOrgId(
orgId: OrgId
) -> SearchQueryBuilder
Starts building a search query based on the specified organization ID.
public static func fromBuildingId(
buildingId: BuildingId
) -> SearchQueryBuilder
Starts building a search query based on the specified building ID.
public static func fromGeoPoint(
geoPoint: GeoPoint
) -> SearchQueryBuilder
Starts building a search query based on the specified center of the search area. The default radius value is 250
. Conflicts with the setSpatialRestriction
method. The method works only with online search.
public func setSpatialRestriction(
spatialRestriction: [GeoPoint]?
) -> SearchQueryBuilder
Sets the search area limitation in the polygon form. The first and the last points of the polygon do not have to coincide.
By default, no limitation is set.
public func setAreaOfInterest(
rect: GeoRect?
) -> SearchQueryBuilder
Sets the rectangular region of interest in geographic coordinates. A typical value is visible_rect from ICamera - the enclosing rectangle of the view area.
public func setAllowedResultTypes(
allowedResultTypes: [ObjectType]
) -> SearchQueryBuilder
Specifies the object types allowed as a result of the request.
By default, all types except Route are allowed.
public func setPageSize(
pageSize: Int32
) -> SearchQueryBuilder
Sets the preferred number of items on the results page. Values in the [1; 50] range are allowed.
Default value is 10.
public func setDirectoryFilter(
filter: DirectoryFilter
) -> SearchQueryBuilder
Sets filtering for the search query.
public func setSortingType(
sortingType: SortingType
) -> SearchQueryBuilder
Sets sorting for the search query.
public func setGeoPoint(
geoPoint: GeoPoint
) -> SearchQueryBuilder
Sets the center of the search area. The default radius value is 250
. Conflicts with the setSpatialRestriction
method.
public func setRadius(
radius: Meter
) -> SearchQueryBuilder
Sets the radius of the search area in meters. Works only with the set GeoPoint
value. For a search query at a point, the limit is from 0 to 2000. For other queries, the limit is from 0 to 50,000.