You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by "jsinovassin (via GitHub)" <gi...@apache.org> on 2023/03/27 13:44:39 UTC

[GitHub] [unomi] jsinovassin commented on a diff in pull request #599: UNOMI-709: avoid updating property type mapping in case a mapping alr…

jsinovassin commented on code in PR #599:
URL: https://github.com/apache/unomi/pull/599#discussion_r1149262867


##########
persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java:
##########
@@ -1621,16 +1626,31 @@ private String convertValueTypeToESType(String valueTypeId) {
                 return "date";
             case "string":
             case "id":
+            case "email": // TODO Consider supporting email mapping in ES, right now will be map to text to avoid warning in logs
                 return "text";
             default:
                 return null;
         }
     }
 
-    private void putMapping(final String source, final String indexName) throws IOException {
-        PutMappingRequest putMappingRequest = new PutMappingRequest(indexName);
-        putMappingRequest.source(source, XContentType.JSON);
-        client.indices().putMapping(putMappingRequest, RequestOptions.DEFAULT);
+    private boolean putMapping(final String source, final String indexName) throws IOException {

Review Comment:
   Is it necessary to return a result here? I don't see in the code where we check the result



-- 
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