Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datahub: geometry boost error if area of competence is empty #694

Closed
fgravin opened this issue Nov 18, 2023 · 2 comments · Fixed by #700
Closed

Datahub: geometry boost error if area of competence is empty #694

fgravin opened this issue Nov 18, 2023 · 2 comments · Fixed by #700
Assignees
Labels
bug Something isn't working

Comments

@fgravin
Copy link
Member

fgravin commented Nov 18, 2023

Issue
If the geometry boost is enabled in the configuration, and it returns an empty geometry

coordinates
: 
[[]]
type
: 
"Polygon"

Then main search returns an error

Error is: Bad Request.
Request:
{"aggregations":{},"from":0,"size":10,"sort":[{"_score":"desc"}],"query":{"bool":{"must":[{"terms":
{"isTemplate":["n"]}}],"must_not":{"terms":{"resourceType":["service","map","map/static","mapDigital"]}},
"should":[{"geo_shape":{"geom":{"shape":{"type":"Polygon","coordinates":[[]]},"relation":"within"},"boost":10}},
{"geo_shape":{"geom":{"shape":{"type":"Polygon","coordinates":[[]]},"relation":"intersects"},"boost":7}}],
"filter":[{"query_string":{"query":"*:* AND (draft:n OR draft:e)"}}]}},"track_total_hits":true,"_source":["uuid","id","title","resource*","resourceTitleObject","resourceAbstractObject","overview","logo",
"codelist_status_text","linkProtocol","contactForResource*.organisation*","contact*.organisation*",
"userSavedCount","op*","groupOwner","owner","id"]}
.
Error:
{"error":{"root_cause":[{"type":"exception","reason":"not enough points to build a line"}],
"type":"x_content_parse_exception","reason":"[1:281] [bool] failed to parse field [should]","caused_by":
{"type":"x_content_parse_exception","reason":"Failed to build [geojson] after last required field arrived","caused_by":
{"type":"exception","reason":"not enough points to build a line"}}},"status":400}.

Expected
This case is handled and does not break the search

@fgravin fgravin added the bug Something isn't working label Nov 18, 2023
@fgravin fgravin self-assigned this Nov 18, 2023
@jahow
Copy link
Collaborator

jahow commented Nov 20, 2023

The geometry given in example is invalid I think? We should better handle this case yes

@fgravin
Copy link
Member Author

fgravin commented Nov 20, 2023

The geometry given in example is invalid I think? We should better handle this case yes

I don't know, but when the organization has no area of competence, the geOrchestra console returns that. Maybe we should fix the console as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants