You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by jk...@apache.org on 2021/07/02 09:28:52 UTC

[unomi] branch fixIndexTemplateName created (now d223d94)

This is an automated email from the ASF dual-hosted git repository.

jkevan pushed a change to branch fixIndexTemplateName
in repository https://gitbox.apache.org/repos/asf/unomi.git.


      at d223d94  UNOMI-498: fix index template name to avoid conflict between multiple Unomi instances on the same ES server

This branch includes the following new commits:

     new d223d94  UNOMI-498: fix index template name to avoid conflict between multiple Unomi instances on the same ES server

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[unomi] 01/01: UNOMI-498: fix index template name to avoid conflict between multiple Unomi instances on the same ES server

Posted by jk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jkevan pushed a commit to branch fixIndexTemplateName
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit d223d9435471f5b914213cec943a5cc2847b9d8a
Author: Kevan <ke...@jahia.com>
AuthorDate: Fri Jul 2 11:28:28 2021 +0200

    UNOMI-498: fix index template name to avoid conflict between multiple Unomi instances on the same ES server
---
 itests/src/test/resources/validation/file_small.json    | 17 +++++++++++++++++
 .../ElasticSearchPersistenceServiceImpl.java            |  2 +-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/itests/src/test/resources/validation/file_small.json b/itests/src/test/resources/validation/file_small.json
new file mode 100644
index 0000000..6fc32fa
--- /dev/null
+++ b/itests/src/test/resources/validation/file_small.json
@@ -0,0 +1,17 @@
+{
+  "sessionId": "dummy-session-id",
+  "events":[
+    {
+      "eventType":"dummy_event_type",
+      "scope":"dummy_scope",
+      "source":{
+        "itemType":"pageView",
+        "scope":"dummy_scope",
+        "itemId":"pageView",
+        "properties":{
+          "myProperty": "Well sized property"
+        }
+      }
+    }
+  ]
+}
\ No newline at end of file
diff --git a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java
index eac14c7..f2778c5 100644
--- a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java
+++ b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java
@@ -1232,7 +1232,7 @@ public class ElasticSearchPersistenceServiceImpl implements PersistenceService,
             protected Boolean execute(Object... args) throws IOException {
                 boolean executedSuccessfully = true;
                 for (String itemName : itemsMonthlyIndexed) {
-                    PutIndexTemplateRequest putIndexTemplateRequest = new PutIndexTemplateRequest("context-" + itemName + "-date-template")
+                    PutIndexTemplateRequest putIndexTemplateRequest = new PutIndexTemplateRequest(indexPrefix + "-" + itemName + "-date-template")
                             .patterns(Collections.singletonList(getMonthlyIndexForQuery(itemName)))
                             .order(1)
                             .settings("{\n" +