Search query builder.
The search is performed on the global index and local segment indexes,
where a segment is a subdivision of the global map.
The process of selecting segments for search is done as follows (in descending priority order):If an area is explicitly specified as a polygon in the request (spatial_restriction), it is taken into account first.
The methods below in priority are disabled, but used to consider distances in the search relevancy.When specifying a rectangular area of interest (bounding_rect), the search is performed in its neighbourhood.If no higher-priority parameters are specified, the user's position is taken into account.
TODO: This condition is not working yet. It will be fixed in upcoming releases.When mentioning a widely known object (city, region, or other toponym) in the search query,
the segment that contains the point of the found object from the global index is added to the search.If nothing from the above is specified, then the search is performed on the global index.