From 1e9de5825caf1e4500852b02be0eb73a626fb1dc Mon Sep 17 00:00:00 2001 From: kpatel Date: Mon, 31 Mar 2014 16:36:55 -0400 Subject: [PATCH 1/4] Upgrade to elasticsearch 1.0.1 --- pom.xml | 2 +- .../search/facet/script/SimpleScriptFacetTests.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 25d4b32..d6d1ec4 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ - 0.90.3 + 1.0.1 diff --git a/src/test/java/org/elasticsearch/search/facet/script/SimpleScriptFacetTests.java b/src/test/java/org/elasticsearch/search/facet/script/SimpleScriptFacetTests.java index ab8b2bf..e7baa3e 100644 --- a/src/test/java/org/elasticsearch/search/facet/script/SimpleScriptFacetTests.java +++ b/src/test/java/org/elasticsearch/search/facet/script/SimpleScriptFacetTests.java @@ -84,7 +84,7 @@ public void testBinaryFacet() throws Exception { .endObject()).execute().actionGet(); } - client().admin().indices().prepareFlush().setRefresh(true).execute().actionGet(); + client().admin().indices().prepareFlush().execute().actionGet(); for (int i = 0; i < 5; i++) { client().prepareIndex("test", "type1").setSource(jsonBuilder().startObject() @@ -171,7 +171,7 @@ public void testUpdateFacet() throws Exception { .endObject()).execute().actionGet(); } - client().admin().indices().prepareFlush().setRefresh(true).execute().actionGet(); + client().admin().indices().prepareFlush().execute().actionGet(); for (int i = 0; i < 5; i++) { client().prepareIndex("test1", "type1").setSource(jsonBuilder().startObject() @@ -271,7 +271,7 @@ public void testCharFrequencies() throws Exception { .field("message", "IJKLMNOP") .endObject()).execute().actionGet(); - client().admin().indices().prepareFlush().setRefresh(true).execute().actionGet(); + client().admin().indices().prepareFlush().execute().actionGet(); client().admin().indices().prepareRefresh().execute().actionGet(); @@ -328,7 +328,7 @@ public void testClientAccessFromScript() throws Exception { .field("message", "foo bar") .endObject()).execute().actionGet(); - client().admin().indices().prepareFlush().setRefresh(true).execute().actionGet(); + client().admin().indices().prepareFlush().execute().actionGet(); client().admin().indices().prepareRefresh().execute().actionGet(); @@ -378,7 +378,7 @@ public void testScriptParams() throws Exception { .field("num", i) .endObject()).execute().actionGet(); } - client().admin().indices().prepareFlush().setRefresh(true).execute().actionGet(); + client().admin().indices().prepareFlush().execute().actionGet(); client().admin().indices().prepareRefresh().execute().actionGet(); From 277eed6d9e1d36ce3916bd7df237aed4fe957ae9 Mon Sep 17 00:00:00 2001 From: kpatel Date: Tue, 8 Apr 2014 15:20:34 -0400 Subject: [PATCH 2/4] Upgrade to 1.1.0 --- pom.xml | 2 +- .../search/facet/script/SimpleScriptFacetTests.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index d6d1ec4..835774f 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ - 1.0.1 + 1.1.0 diff --git a/src/test/java/org/elasticsearch/search/facet/script/SimpleScriptFacetTests.java b/src/test/java/org/elasticsearch/search/facet/script/SimpleScriptFacetTests.java index e7baa3e..ef87051 100644 --- a/src/test/java/org/elasticsearch/search/facet/script/SimpleScriptFacetTests.java +++ b/src/test/java/org/elasticsearch/search/facet/script/SimpleScriptFacetTests.java @@ -142,7 +142,7 @@ public void testBinaryFacet() throws Exception { } - @Test + //@Test public void testUpdateFacet() throws Exception { try { client().admin().indices().prepareDelete("test1").execute().actionGet(); @@ -309,7 +309,7 @@ public void testCharFrequencies() throws Exception { contains(2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); } - @Test + //@Test public void testClientAccessFromScript() throws Exception { try { client().admin().indices().prepareDelete("test1").execute().actionGet(); From c263f3ade99222ec6581cfe8bcdddea8de40c47c Mon Sep 17 00:00:00 2001 From: kpatel Date: Tue, 22 Apr 2014 03:46:46 -0400 Subject: [PATCH 3/4] upgrade elastic search to 1.1.1 --- pom.xml | 2 +- .../search/facet/script/SimpleScriptFacetTests.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 835774f..be828aa 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ - 1.1.0 + 1.1.1 diff --git a/src/test/java/org/elasticsearch/search/facet/script/SimpleScriptFacetTests.java b/src/test/java/org/elasticsearch/search/facet/script/SimpleScriptFacetTests.java index ef87051..0a8fc7f 100644 --- a/src/test/java/org/elasticsearch/search/facet/script/SimpleScriptFacetTests.java +++ b/src/test/java/org/elasticsearch/search/facet/script/SimpleScriptFacetTests.java @@ -142,7 +142,7 @@ public void testBinaryFacet() throws Exception { } - //@Test + @Test public void testUpdateFacet() throws Exception { try { client().admin().indices().prepareDelete("test1").execute().actionGet(); @@ -186,7 +186,7 @@ public void testUpdateFacet() throws Exception { } client().admin().indices().prepareRefresh().execute().actionGet(); - + //org.elasticsearch.index.mapper.Uid. SearchResponse searchResponse = client().prepareSearch() .setSearchType(SearchType.COUNT) .setIndices("test1", "test2") @@ -197,8 +197,9 @@ public void testUpdateFacet() throws Exception { .field("init_script", "index = _ctx.request().index();") .field("map_script", "" + "uid = doc._uid.value;" + - "id = org.elasticsearch.index.mapper.Uid.idFromUid(uid);" + - "type = org.elasticsearch.index.mapper.Uid.typeFromUid(uid);" + + "uidId = org.elasticsearch.index.mapper.Uid.createUid(uid);" + + "id = uidId.id();" + + "type = uidId.type();" + "if (!_source.isEmpty()) {" + " modified = true;" + " map = _source.source();" + From ecbe298a664a1ea076d4eb31b0e4dabbfec861dd Mon Sep 17 00:00:00 2001 From: kpatel Date: Wed, 23 Apr 2014 05:54:24 -0400 Subject: [PATCH 4/4] Fox unit test --- .../search/facet/script/SimpleScriptFacetTests.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/elasticsearch/search/facet/script/SimpleScriptFacetTests.java b/src/test/java/org/elasticsearch/search/facet/script/SimpleScriptFacetTests.java index 0a8fc7f..8cb62e4 100644 --- a/src/test/java/org/elasticsearch/search/facet/script/SimpleScriptFacetTests.java +++ b/src/test/java/org/elasticsearch/search/facet/script/SimpleScriptFacetTests.java @@ -186,7 +186,6 @@ public void testUpdateFacet() throws Exception { } client().admin().indices().prepareRefresh().execute().actionGet(); - //org.elasticsearch.index.mapper.Uid. SearchResponse searchResponse = client().prepareSearch() .setSearchType(SearchType.COUNT) .setIndices("test1", "test2") @@ -310,7 +309,7 @@ public void testCharFrequencies() throws Exception { contains(2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); } - //@Test + @Test public void testClientAccessFromScript() throws Exception { try { client().admin().indices().prepareDelete("test1").execute().actionGet(); @@ -340,7 +339,7 @@ public void testClientAccessFromScript() throws Exception { .startObject("facets") .startObject("facet1") .startObject("script") - .field("map_script", "_client.prepareUpdate(\"test1\", \"type1\", org.elasticsearch.index.mapper.Uid.idFromUid(doc['_uid'].value)).setDoc(\"{\\\"message\\\": \\\"baz\\\"}\").execute().actionGet()") + .field("map_script", "_client.prepareUpdate(\"test1\", \"type1\", org.elasticsearch.index.mapper.Uid.createUid(doc['_uid'].value).id()).setDoc(\"{\\\"message\\\": \\\"baz\\\"}\").execute().actionGet()") .endObject() .endObject() .endObject()