Repository: polygene-java
Updated Branches:
  refs/heads/develop fc7c43269 -> ec2855f55


Upgrade ElasticSearch dependency version to 5.5


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/361f6fe9
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/361f6fe9
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/361f6fe9

Branch: refs/heads/develop
Commit: 361f6fe97b34196154f790485ab7af63c5a4d29d
Parents: fc7c432
Author: Paul Merlin <paulmer...@apache.org>
Authored: Mon Jul 17 08:56:27 2017 +0200
Committer: Paul Merlin <paulmer...@apache.org>
Committed: Mon Jul 17 08:56:27 2017 +0200

----------------------------------------------------------------------
 dependencies.gradle                                            | 6 +++---
 .../polygene/index/elasticsearch/ElasticSearchFinder.java      | 6 +++---
 .../polygene/index/elasticsearch/ElasticSearchIndexer.java     | 3 ++-
 .../elasticsearch/internal/AbstractElasticSearchSupport.java   | 6 ++++--
 4 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/361f6fe9/dependencies.gradle
----------------------------------------------------------------------
diff --git a/dependencies.gradle b/dependencies.gradle
index 2cb6388..ef62cf2 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -51,7 +51,7 @@ def commonsLangVersion = '3.5'
 def commonsValidatorVersion = '1.6'
 def derbyVersion = '10.13.1.1'
 def ehcacheVersion = '3.3.1'
-def elasticsearchVersion = '5.2.2'
+def elasticsearchVersion = '5.5.0'
 def freemarkerVersion = '2.3.26-incubating'
 def geodeVersion = '1.1.1'
 def groovyVersion = '2.4.10'
@@ -97,8 +97,8 @@ dependencies.libraries << [
   elasticsearch       : [ 
"org.elasticsearch:elasticsearch:$elasticsearchVersion",
                           
"org.elasticsearch.client:transport:$elasticsearchVersion",
                           // Elasticsearch 5.0 do not work with log4j 2.7
-                          "org.apache.logging.log4j:log4j-api:2.6.2",
-                          "org.apache.logging.log4j:log4j-core:2.6.2" ],
+                          "org.apache.logging.log4j:log4j-api:2.8.2",
+                          "org.apache.logging.log4j:log4j-core:2.8.2" ],
   freemarker          : "org.freemarker:freemarker:$freemarkerVersion",
   geode               : "org.apache.geode:geode-core:$geodeVersion",
   groovy              : "org.codehaus.groovy:groovy-all:$groovyVersion",

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/361f6fe9/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchFinder.java
----------------------------------------------------------------------
diff --git 
a/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchFinder.java
 
b/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchFinder.java
index 18c49eb..502471b 100644
--- 
a/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchFinder.java
+++ 
b/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchFinder.java
@@ -130,7 +130,7 @@ public interface ElasticSearchFinder
             SearchResponse response = request.execute().actionGet();
 
             return StreamSupport.stream( response.getHits().spliterator(), 
false )
-                                .map( hit -> 
EntityReference.parseEntityReference( hit.id() ) );
+                                .map( hit -> 
EntityReference.parseEntityReference( hit.getId() ) );
         }
 
         @Override
@@ -154,9 +154,9 @@ public interface ElasticSearchFinder
             // Execute
             SearchResponse response = request.execute().actionGet();
 
-            if( response.getHits().totalHits() == 1 )
+            if( response.getHits().getTotalHits() == 1 )
             {
-                return EntityReference.parseEntityReference( 
response.getHits().getAt( 0 ).id() );
+                return EntityReference.parseEntityReference( 
response.getHits().getAt( 0 ).getId() );
             }
 
             return null;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/361f6fe9/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchIndexer.java
----------------------------------------------------------------------
diff --git 
a/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchIndexer.java
 
b/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchIndexer.java
index 0737f86..99bcdab 100644
--- 
a/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchIndexer.java
+++ 
b/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchIndexer.java
@@ -48,6 +48,7 @@ import 
org.apache.polygene.spi.entitystore.StateChangeListener;
 import org.apache.polygene.spi.serialization.JsonSerializer;
 import org.elasticsearch.action.bulk.BulkRequestBuilder;
 import org.elasticsearch.action.bulk.BulkResponse;
+import org.elasticsearch.common.xcontent.XContentType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -169,7 +170,7 @@ public interface ElasticSearchIndexer extends 
StateChangeListener
         {
             bulkBuilder.add( support.client().
                 prepareIndex( support.index(), support.entitiesType(), 
identity ).
-                                        setSource( json ) );
+                    setSource( json, XContentType.JSON ) );
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/361f6fe9/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/internal/AbstractElasticSearchSupport.java
----------------------------------------------------------------------
diff --git 
a/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/internal/AbstractElasticSearchSupport.java
 
b/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/internal/AbstractElasticSearchSupport.java
index d899958..e623c6e 100644
--- 
a/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/internal/AbstractElasticSearchSupport.java
+++ 
b/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/internal/AbstractElasticSearchSupport.java
@@ -19,11 +19,12 @@
  */
 package org.apache.polygene.index.elasticsearch.internal;
 
+import org.apache.polygene.index.elasticsearch.ElasticSearchSupport;
 import org.elasticsearch.client.Client;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.xcontent.XContentBuilder;
 import org.elasticsearch.common.xcontent.XContentFactory;
-import org.apache.polygene.index.elasticsearch.ElasticSearchSupport;
+import org.elasticsearch.common.xcontent.XContentType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -67,7 +68,8 @@ public abstract class AbstractElasticSearchSupport
                                            .endObject()
                                    .endObject()
                                .endObject()
-                               .string() );
+                               .string(),
+                XContentType.JSON);
             XContentBuilder mapping = XContentFactory.jsonBuilder()
                                                      .startObject()
                                                          .startObject( 
entitiesType() )

Reply via email to