You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2015/07/01 01:14:07 UTC
incubator-usergrid git commit: Adding test proving the issue and
added a fix to the mapping for elastic search so the issue should be fixed.
Repository: incubator-usergrid
Updated Branches:
refs/heads/Fix-dates-creation [created] 3b289aa2a
Adding test proving the issue and added a fix to the mapping for elastic search so the issue should be fixed.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/3b289aa2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/3b289aa2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/3b289aa2
Branch: refs/heads/Fix-dates-creation
Commit: 3b289aa2a97767fa094aa122bf3a8c3ddf3a2005
Parents: d8b0d6b
Author: GERey <gr...@apigee.com>
Authored: Tue Jun 30 16:14:04 2015 -0700
Committer: GERey <gr...@apigee.com>
Committed: Tue Jun 30 16:14:04 2015 -0700
----------------------------------------------------------------------
.../persistence/index/impl/IndexingUtils.java | 2 +-
.../collection/CollectionsResourceIT.java | 29 ++++++++++++++++++++
2 files changed, 30 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3b289aa2/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
index ffd98e9..a044054 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
@@ -150,7 +150,7 @@ public class IndexingUtils {
builder = builder
.startObject()
-
+ .field( "date_detection",false )
/** add routing "_routing":{ "required":false, "path":"ug_entityId" **/
.startObject("_routing").field("required",true).field("path",ENTITYID_ID_FIELDNAME).endObject()
.startArray("dynamic_templates")
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3b289aa2/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
index 192fd84..a18da85 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
@@ -121,6 +121,35 @@ public class CollectionsResourceIT extends AbstractRestIT {
*/
}
+ @Test
+ public void postToReservedField() throws Exception {
+ Entity payload = new Entity();
+ payload.put( "term_date", "12/31/9999" );
+ payload.put( "effective_date","2015-04-20T17:41:38.035Z" );
+ payload.put("junk","TEST");
+
+ this.app().collection( "testCollection" ).post( payload );
+ refreshIndex();
+ Thread.sleep( 1000 );
+
+ Collection collection = this.app().collection( "testCollection" ).get();
+
+ assertNotEquals(0, collection.getNumOfEntities() );
+
+ payload = new Entity();
+ payload.put( "term_date","1991-17-10" );
+ payload.put( "effective_date","HELLO WORLD!" );
+ payload.put("junk","TEST");
+
+ this.app().collection( "testCollection" ).post( payload );
+ refreshIndex();
+ Thread.sleep( 1000 );
+
+ collection = this.app().collection( "testCollection" ).get();
+
+ assertEquals( 2, collection.getNumOfEntities() );
+
+ }
/**
* Test posts with a user level token on a path with permissions