You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by GitBox <gi...@apache.org> on 2022/07/12 11:39:00 UTC

[GitHub] [unomi] jkevan commented on a diff in pull request #461: Unomi 603 migration profiles

jkevan commented on code in PR #461:
URL: https://github.com/apache/unomi/pull/461#discussion_r918866072


##########
tools/shell-commands/src/main/resources/requestBody/2.0.0/update_profile_interests.json:
##########
@@ -0,0 +1,4 @@
+{
+    "source": "List interests = new ArrayList(); if(ctx._source.properties.interests != null && !(ctx._source.properties.interests instanceof List)){ for (entry in ctx._source.properties.interests.entrySet()){ Map interest = new HashMap(); interest.put('key',entry.getKey()); interest.put('value', entry.getValue()); interests.add(interest);} ctx._source.properties.remove('interests'); ctx._source.properties.put('interests',interests);}",
+    "lang": "painless"
+}

Review Comment:
   It could be interesting to help on dev + review painless scripts that the script it self should be the file content.
   like: update_profile_interests.painless.
   
   Even if IDE is not capable of handling those file, may be one day it will.
   Also it would help a lot to benefit a least from indentation to be able to read/debug thoses scripts.
   
   Also the "source" and "lang" could be created on the fly by the reindex function.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@unomi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org