-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: personal sort with demo #174
Conversation
Also fix a bug if sort_by is a script with minus in front, and create a real personal sort script and bettre display errors if storing scripts fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have 2 bugs when i try to test sort by personal score :
-
first one can be solved :
page_size: this.pageSize.toString(),
pageSize
can be undefined -
second one, search return :
{ "debug": { "query": { "aggs": { "brands_tags": { "terms": { "field": "brands_tags" } }, "categories_tags": { "terms": { "field": "categories_tags" } }, "nutrition_grades": { "terms": { "field": "nutrition_grades" } }, "ecoscore_grade": { "terms": { "field": "ecoscore_grade" } } }, "sort": [ { "_script": { "type": "number", "script": { "id": "off__personal_score", "params": { "nutri_score": 1, "nova_group": 2, "eco_score": 0, "nova_to_score": [ 100, 100, 100, 75, 4 ], "grades_to_score": { "a": 100, "b": 75, "c": 50, "d": 25, "e": 0 } } }, "order": "desc" } } ], "size": 24, "from": 0 } }, "errors": [ { "title": "es_api_error", "description": "NotFoundError(404, 'search_phase_execution_exception', 'unable to find script [off__personal_score] in cluster state')" } ] }
You have to run docker compose run --rm api python -m app sync-scripts (BTW I should add it to the deploy action) |
A sort option for scripts + a demo in off.html
Part of: #172