Repository: incubator-unomi
Updated Branches:
  refs/heads/master cac08f5f9 -> a38c2c086


UNOMI-152 Fix monthly index New Year's bug

When formatting the date around new year's day, retrieving WEEK_YEAR can
yield next year or previous year as result. We should simply use YEAR.

More details: 
https://stackoverflow.com/questions/8686331/y-returns-2012-while-y-returns-2011-in-simpledateformat


Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/408e2d55
Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/408e2d55
Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/408e2d55

Branch: refs/heads/master
Commit: 408e2d55586a8a9756e33b63cb814733c893459b
Parents: 2ca6dc6
Author: Jarek Lipski <jlip...@jahia.com>
Authored: Tue Feb 13 15:34:01 2018 +0100
Committer: Jarek Lipski <jlip...@jahia.com>
Committed: Tue Feb 13 15:52:30 2018 +0100

----------------------------------------------------------------------
 .../elasticsearch/ElasticSearchPersistenceServiceImpl.java         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/408e2d55/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java
----------------------------------------------------------------------
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 933724e..8a20f95 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
@@ -506,7 +506,7 @@ public class ElasticSearchPersistenceServiceImpl implements 
PersistenceService,
     }
 
     private String getMonthlyIndexName(Date date) {
-        String d = new SimpleDateFormat("-YYYY-MM").format(date);
+        String d = new SimpleDateFormat("-yyyy-MM").format(date);
         String monthlyIndexName = indexName + d;
         return monthlyIndexName;
     }

Reply via email to