diff --git a/src/main/java/eu/ec/doris/kohesio/controller/MapController.java b/src/main/java/eu/ec/doris/kohesio/controller/MapController.java index bee8a6b..680fa48 100644 --- a/src/main/java/eu/ec/doris/kohesio/controller/MapController.java +++ b/src/main/java/eu/ec/doris/kohesio/controller/MapController.java @@ -215,7 +215,7 @@ public ResponseEntity euSearchProjectMap( logger.info("Found: {} projects by subdivision", numberTotal); if (zoom >= 9 || numberTotal < maxNumberOfprojectBeforeGoingToSubRegion || ((JSONArray) tmp.getBody().get("subregions")).size() <= 1) { List features = getProjectsPoints( - language, search, bboxToUse, granularityRegion, limit, offset, timeout + language, search, bboxToUse, granularityRegion, limit, offset, keywords != null, timeout ); Instant instant = Instant.now(); SuperCluster superCluster = clusterService.createCluster( @@ -670,6 +670,7 @@ public ResponseEntity euSearchProjectMapPoint( granularityRegion, limit, offset, + keywords != null, timeout ) ); @@ -1250,6 +1251,7 @@ private List getProjectsPoints( String granularityRegion, Integer limit, Integer offset, + boolean useLuceneForGeoSparql, int timeout ) throws Exception { logger.info("Search project map point: language {} search {} boundingBox {} limit {} offset {}", language, search, boundingBox, limit, offset); @@ -1273,6 +1275,10 @@ private List getProjectsPoints( + " }"; } String filterBbox = "FILTER((" + boundingBox.toLiteral() + ",?coordinates))"; + // hack to run the geosparql not over lucene in case there is a freetext query over lucene + if (!useLuceneForGeoSparql) { + filterBbox = "FILTER((?coordinates," + boundingBox.toLiteral() + "))"; + } query += " " + filterBbox + " " + filterBbox + " "; if (granularityRegion != null) { Geometry geometryGranularityRegion = geoJSONReader.read(facetController.nutsRegion.get(granularityRegion).geoJson.replace("'", "\""));