Skip to content

Commit

Permalink
hack to scale keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
DiaZork committed Jan 17, 2025
1 parent 4f32ee2 commit 0cb41e3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public ResponseEntity<JSONObject> euSearchProjectMap(
logger.info("Found: {} projects by subdivision", numberTotal);
if (zoom >= 9 || numberTotal < maxNumberOfprojectBeforeGoingToSubRegion || ((JSONArray) tmp.getBody().get("subregions")).size() <= 1) {
List<Feature> 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(
Expand Down Expand Up @@ -670,6 +670,7 @@ public ResponseEntity euSearchProjectMapPoint(
granularityRegion,
limit,
offset,
keywords != null,
timeout
)
);
Expand Down Expand Up @@ -1250,6 +1251,7 @@ private List<Feature> 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);
Expand All @@ -1273,6 +1275,10 @@ private List<Feature> getProjectsPoints(
+ " }";
}
String filterBbox = "FILTER(<http://www.opengis.net/def/function/geosparql/ehContains>(" + boundingBox.toLiteral() + ",?coordinates))";
// hack to run the geosparql not over lucene in case there is a freetext query over lucene
if (!useLuceneForGeoSparql) {
filterBbox = "FILTER(<http://www.opengis.net/def/function/geosparql/sfWithin>(?coordinates," + boundingBox.toLiteral() + "))";
}
query += " " + filterBbox + " " + filterBbox + " ";
if (granularityRegion != null) {
Geometry geometryGranularityRegion = geoJSONReader.read(facetController.nutsRegion.get(granularityRegion).geoJson.replace("'", "\""));
Expand Down

0 comments on commit 0cb41e3

Please sign in to comment.