log.debug("Range " + range);
log.debug("Maximum " + maxItem);
SearchPeriods periodValue = (period.isEmpty() ? SearchPeriods.ALLTIME
: SearchPeriods.getPeriodString(period));
TypeSearchResult typeValue = (type.isEmpty() ? TypeSearchResult.ALL
: TypeSearchResult.getTypeSearchResult(type));
TypeSearchResult searchType = TypeSearchResult
.getTypeSearchResult(typeOfSearch);
List<ItemGeoLocationBean> itemsByLocation = new ArrayList<ItemGeoLocationBean>();
final Map<String, Object> jsonResponse = new HashMap<String, Object>();
if (searchType.equals(TypeSearchResult.ALL)) {
itemsByLocation = getLocationService().retrieveItemsByGeo(
range, maxItem, typeValue, longitude, latitude,
periodValue);
log.debug("Items by geo location " + itemsByLocation.size());
jsonResponse.put("itemsByGeo", itemsByLocation);
} else if (searchType.equals(TypeSearchResult.HASHTAG)) {
if (tagName == null) {
throw new EnMeSearchException("search params required.");
} else {
itemsByLocation = getLocationService()
.retreiveHashTagUsebyGeoLo(range, maxItem,
typeValue, longitude, latitude, tagName,
periodValue);
log.debug("Hashtag use by geo location "
+ itemsByLocation.size());
jsonResponse.put("hashtagUsebyGeo", itemsByLocation);
}
} else if (searchType.equals(TypeSearchResult.SOCIALNETWORK)) {
itemsByLocation = getLocationService()
.retrieveSocialNetworksPublicationsbyGeoLocation(range,
maxItem, typeValue, longitude, latitude,
periodValue);
log.debug("Social publications by geo location "