private String buildSearchEndpoint(String query, String objectType, Reading reading) {
        String q = null;
        if (query != null) {
            q = HttpParameter.encode(query);
        }
        StringBuilder url = new StringBuilder()
                            .append(buildEndpoint("search"))
                            .append(objectType == null ? "" : "?type=" + objectType)
                            .append(q == null ? "" : objectType == null ? "?q=" + q : "&q=" + q)
                            .append(reading == null ? "" : "&" + reading.getQuery());
        return url.toString();
    }