@Override
    public Result search(Query query, Execution execution) {
        String bb = query.properties().getString(posBb);
        String ll = query.properties().getString(posLl);
        String xy = query.properties().getString(posXy);

        if (ll == null && xy == null && bb == null) {
            return execution.search(query); // Nothing to do
        }
        if (query.getRanking().getLocation() != null) {
            // this searcher is a NOP if there is already a location
            // in the query
            query.trace("query already has a location set, not processing 'pos' params", false, 1);
            return execution.search(query);
        }

        Location loc = new Location();
        loc.setDimensions(2);
        String posAttribute = query.properties().getString(posAttributeName);
        loc.setAttribute(posAttribute);

        try {
            if (ll == null && xy == null) {
                parseBoundingBox(bb, loc);
            } else {
                if (ll != null && xy != null) {
                    throw new IllegalArgumentException("Cannot handle both lat/long and xy coords at the same time");
                }
                if (ll != null) {
                    handleGeoCircle(query, ll, loc);
                }
                if (xy != null) {
                    handleXyCircle(query, xy, loc);
                }
                if (bb != null) {
                    parseBoundingBox(bb, loc);
                }
            }
        }
        catch (IllegalArgumentException e) {
            return new Result(query, ErrorMessage.createInvalidQueryParameter("Error in pos parameters: " +
                                                                              Exceptions.toMessageString(e)));
        }
        // and finally:
        query.getRanking().setLocation(loc);
        return execution.search(query);
    }
A searcher converting human-readable position parameters
into internal format.
<br>
Reads the following query properties:
<ul>
 <li> pos.ll (geographical latitude and longitude)
 <li> pos.xy (alternate to pos.ll - direct x and y in internal units)
 <li> pos.radius (distance in one of:
       internal units (no suffix), meter (m), kilometer (km) or miles (mi)
</ul>

@author arnej27959
container-search/src/main/java/com/yahoo/prelude/searcher/PosSearcher.java