camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [3/5] camel git commit: [CAMEL-9360] Upgrade to elasticsearch 2.x and upgrade Lucene to version 5.2.1
Date Sun, 06 Dec 2015 20:17:42 GMT
[CAMEL-9360] Upgrade to elasticsearch 2.x and upgrade Lucene to version 5.2.1


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7d86043c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7d86043c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7d86043c

Branch: refs/heads/master
Commit: 7d86043c79639fc630db69238b0a93ede3c7819f
Parents: e839ade
Author: Andrea Cosentino <ancosen@gmail.com>
Authored: Sun Dec 6 09:45:42 2015 +0100
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Sun Dec 6 18:48:18 2015 +0100

----------------------------------------------------------------------
 .../elasticsearch/ElasticsearchComponent.java   |  6 +++--
 .../ElasticsearchConfiguration.java             | 23 --------------------
 .../elasticsearch/ElasticsearchConstants.java   |  3 ---
 .../elasticsearch/ElasticsearchEndpoint.java    | 13 ++++-------
 .../elasticsearch/ElasticsearchProducer.java    | 12 ----------
 .../ElasticsearchActionRequestConverter.java    |  5 -----
 .../elasticsearch/ElasticsearchBaseTest.java    |  4 ++--
 .../elasticsearch/ElasticsearchIndexTest.java   |  2 +-
 .../camel/component/lucene/LuceneConstants.java |  2 +-
 .../camel/component/lucene/LuceneIndexer.java   |  8 +++----
 .../camel/component/lucene/LuceneSearcher.java  |  6 ++---
 .../resources/solr/collection1/core.properties  |  2 +-
 parent/pom.xml                                  |  8 +++----
 13 files changed, 24 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7d86043c/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchComponent.java
b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchComponent.java
index f12b414..1a2187f 100644
--- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchComponent.java
+++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchComponent.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.elasticsearch;
 
+import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -67,7 +69,7 @@ public class ElasticsearchComponent extends UriEndpointComponent {
         return endpoint;
     }
     
-    private List<InetSocketTransportAddress> parseTransportAddresses(String ipsString,
ElasticsearchConfiguration config) {
+    private List<InetSocketTransportAddress> parseTransportAddresses(String ipsString,
ElasticsearchConfiguration config) throws UnknownHostException {
         if (ipsString == null || ipsString.isEmpty()) {
             return null;
         }
@@ -82,7 +84,7 @@ public class ElasticsearchComponent extends UriEndpointComponent {
                 throw new IllegalArgumentException();
             }
             Integer port = split.length > 1 ? Integer.parseInt(split[1]) : ElasticsearchConstants.DEFAULT_PORT;
-            addressesTrAd.add(new InetSocketTransportAddress(hostname, port));
+			addressesTrAd.add(new InetSocketTransportAddress(InetAddress.getByName(hostname), port));
         }
         return addressesTrAd;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/7d86043c/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
index 1069902..3ea0603 100644
--- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
+++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
@@ -16,24 +16,14 @@
  */
 package org.apache.camel.component.elasticsearch;
 
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
-import java.util.Map;
 
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriParams;
 import org.apache.camel.spi.UriPath;
 import org.elasticsearch.action.WriteConsistencyLevel;
-import org.elasticsearch.action.support.replication.ReplicationType;
 import org.elasticsearch.common.transport.InetSocketTransportAddress;
-import org.elasticsearch.node.Node;
-import org.elasticsearch.node.NodeBuilder;
-
-import static org.elasticsearch.node.NodeBuilder.nodeBuilder;
 
 @UriParams
 public class ElasticsearchConfiguration {
@@ -51,8 +41,6 @@ public class ElasticsearchConfiguration {
     private String indexType;
     @UriParam(defaultValue = "DEFAULT")
     private WriteConsistencyLevel consistencyLevel = ElasticsearchConstants.DEFAULT_CONSISTENCY_LEVEL;
-    @UriParam(defaultValue = "DEFAULT")
-    private ReplicationType replicationType = ElasticsearchConstants.DEFAULT_REPLICATION_TYPE;
     @UriParam
     private Boolean data;
     @UriParam
@@ -116,17 +104,6 @@ public class ElasticsearchConfiguration {
     public void setConsistencyLevel(WriteConsistencyLevel consistencyLevel) {
         this.consistencyLevel = consistencyLevel;
     }
-
-    /**
-     * The replication type to use with INDEX and BULK operations (can be any of SYNC, ASYNC
or DEFAULT)
-     */
-    public ReplicationType getReplicationType() {
-        return replicationType;
-    }
-
-    public void setReplicationType(ReplicationType replicationType) {
-        this.replicationType = replicationType;
-    }
     
     /**
      * Is the node going to be allowed to allocate data (shards) to it or not. This setting
map to the <tt>node.data</tt> setting.

http://git-wip-us.apache.org/repos/asf/camel/blob/7d86043c/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConstants.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConstants.java
b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConstants.java
index a8f79e1..7ccbf00 100644
--- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConstants.java
+++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConstants.java
@@ -18,7 +18,6 @@
 package org.apache.camel.component.elasticsearch;
 
 import org.elasticsearch.action.WriteConsistencyLevel;
-import org.elasticsearch.action.support.replication.ReplicationType;
 
 public interface ElasticsearchConstants {
 
@@ -35,7 +34,6 @@ public interface ElasticsearchConstants {
     String PARAM_INDEX_NAME = "indexName";
     String PARAM_INDEX_TYPE = "indexType";
     String PARAM_CONSISTENCY_LEVEL = "consistencyLevel";
-    String PARAM_REPLICATION_TYPE = "replicationType";
     String PARENT = "parent";
     String TRANSPORT_ADDRESSES = "transportAddresses";
     String PROTOCOL = "elasticsearch";
@@ -44,7 +42,6 @@ public interface ElasticsearchConstants {
     String PORT = "port";
     Integer DEFAULT_PORT = 9300;
     WriteConsistencyLevel DEFAULT_CONSISTENCY_LEVEL = WriteConsistencyLevel.DEFAULT;
-    ReplicationType DEFAULT_REPLICATION_TYPE = ReplicationType.DEFAULT;
     String TRANSPORT_ADDRESSES_SEPARATOR_REGEX = ",";
     String IP_PORT_SEPARATOR_REGEX = ":";
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/7d86043c/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
index e6f0099..114a03b 100644
--- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
+++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.component.elasticsearch;
 
+import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -27,7 +28,6 @@ import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.elasticsearch.client.Client;
 import org.elasticsearch.client.transport.TransportClient;
-import org.elasticsearch.common.settings.ImmutableSettings;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.transport.InetSocketTransportAddress;
 import org.elasticsearch.common.transport.TransportAddress;
@@ -83,20 +83,16 @@ public class ElasticsearchEndpoint extends DefaultEndpoint {
                 LOG.info("Joining ElasticSearch cluster " + configuration.getClusterName());
             }
             if (configuration.getIp() != null) {
-                this.client = new TransportClient(getSettings())
-                        .addTransportAddress(new InetSocketTransportAddress(configuration.getIp(),
configuration.getPort()));
-
+                this.client = TransportClient.builder().settings(getSettings()).build().addTransportAddress(new
InetSocketTransportAddress(InetAddress.getByName(configuration.getIp()), configuration.getPort()));
             } else if (configuration.getTransportAddressesList() != null
                     && !configuration.getTransportAddressesList().isEmpty()) {
                 List<TransportAddress> addresses = new ArrayList(configuration.getTransportAddressesList().size());
                 for (TransportAddress address : configuration.getTransportAddressesList())
{
                     addresses.add(address);
                 }
-                this.client = new TransportClient(getSettings())
-                        .addTransportAddresses(addresses.toArray(new TransportAddress[addresses.size()]));
+                this.client = TransportClient.builder().settings(getSettings()).build().addTransportAddresses(addresses.toArray(new
TransportAddress[addresses.size()]));
             } else {
                 NodeBuilder builder = nodeBuilder().local(configuration.isLocal()).data(configuration.getData());
-                builder.getSettings().classLoader(Settings.class.getClassLoader());
                 if (configuration.isLocal()) {
                     builder.getSettings().put("http.enabled", false);
                 }
@@ -110,12 +106,11 @@ public class ElasticsearchEndpoint extends DefaultEndpoint {
     }
 
     private Settings getSettings() {
-        return ImmutableSettings.settingsBuilder()
+        return Settings.settingsBuilder()
                 // setting the classloader here will allow the underlying elasticsearch-java
                 // class to find its names.txt in an OSGi environment (otherwise the thread
                 // classloader is used, which won't be able to see the file causing a startup
                 // exception).
-                .classLoader(Settings.class.getClassLoader())
                 .put("cluster.name", configuration.getClusterName())
                 .put("client.transport.ignore_cluster_name", false)
                 .put("node.client", true)

http://git-wip-us.apache.org/repos/asf/camel/blob/7d86043c/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java
b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java
index 476f7b7..4eac708 100644
--- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java
+++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java
@@ -55,7 +55,6 @@ public class ElasticsearchProducer extends DefaultProducer {
         // header, the configuration is used.
         // In the event we can't discover the operation from a, b or c we throw
         // an error.
-
         Object request = exchange.getIn().getBody();
         if (request instanceof IndexRequest) {
             return ElasticsearchConstants.OPERATION_INDEX;
@@ -123,13 +122,6 @@ public class ElasticsearchProducer extends DefaultProducer {
             configConsistencyLevel = true;
         }
 
-        boolean configReplicationType = false;
-        String replicationType = message.getHeader(ElasticsearchConstants.PARAM_REPLICATION_TYPE,
String.class);
-        if (replicationType == null) {
-            message.setHeader(ElasticsearchConstants.PARAM_REPLICATION_TYPE, getEndpoint().getConfig().getReplicationType());
-            configReplicationType = true;
-        }
-
         Client client = getEndpoint().getClient();
         if (ElasticsearchConstants.OPERATION_INDEX.equals(operation)) {
             IndexRequest indexRequest = message.getBody(IndexRequest.class);
@@ -180,9 +172,5 @@ public class ElasticsearchProducer extends DefaultProducer {
             message.removeHeader(ElasticsearchConstants.PARAM_CONSISTENCY_LEVEL);
         }
 
-        if (configReplicationType) {
-            message.removeHeader(ElasticsearchConstants.PARAM_REPLICATION_TYPE);
-        }
-
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/7d86043c/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java
b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java
index cc6e9bd..fcb1866 100644
--- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java
+++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java
@@ -28,7 +28,6 @@ import org.elasticsearch.action.delete.DeleteRequest;
 import org.elasticsearch.action.get.GetRequest;
 import org.elasticsearch.action.index.IndexRequest;
 import org.elasticsearch.action.search.SearchRequest;
-import org.elasticsearch.action.support.replication.ReplicationType;
 import org.elasticsearch.action.update.UpdateRequest;
 import org.elasticsearch.common.xcontent.XContentBuilder;
 
@@ -56,8 +55,6 @@ public final class ElasticsearchActionRequestConverter {
         return updateRequest
                 .consistencyLevel(exchange.getIn().getHeader(
                         ElasticsearchConstants.PARAM_CONSISTENCY_LEVEL, WriteConsistencyLevel.class))
-                .replicationType(exchange.getIn().getHeader(
-                        ElasticsearchConstants.PARAM_REPLICATION_TYPE, ReplicationType.class))
                 .parent(exchange.getIn().getHeader(
                         ElasticsearchConstants.PARENT, String.class))
                 .index(exchange.getIn().getHeader(
@@ -88,8 +85,6 @@ public final class ElasticsearchActionRequestConverter {
         return indexRequest
                 .consistencyLevel(exchange.getIn().getHeader(
                         ElasticsearchConstants.PARAM_CONSISTENCY_LEVEL, WriteConsistencyLevel.class))
-                .replicationType(exchange.getIn().getHeader(
-                        ElasticsearchConstants.PARAM_REPLICATION_TYPE, ReplicationType.class))
                 .parent(exchange.getIn().getHeader(
                         ElasticsearchConstants.PARENT, String.class))
                 .index(exchange.getIn().getHeader(

http://git-wip-us.apache.org/repos/asf/camel/blob/7d86043c/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchBaseTest.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchBaseTest.java
b/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchBaseTest.java
index 37031be..c04c77a 100644
--- a/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchBaseTest.java
+++ b/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchBaseTest.java
@@ -22,7 +22,7 @@ import java.util.Map;
 import org.apache.camel.CamelContext;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.elasticsearch.client.Client;
-import org.elasticsearch.common.settings.ImmutableSettings;
+import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.node.Node;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -40,7 +40,7 @@ public class ElasticsearchBaseTest extends CamelTestSupport {
 
         // create an embedded node to resue
         node = nodeBuilder().local(true)
-                .settings(ImmutableSettings.settingsBuilder().put("http.enabled", false).put("path.data",
"target/data"))
+                .settings(Settings.settingsBuilder().put("http.enabled", false).put("path.data",
"target/data").put("path.home", "target/home"))
                 .node();
 
         client = node.client();

http://git-wip-us.apache.org/repos/asf/camel/blob/7d86043c/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchIndexTest.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchIndexTest.java
b/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchIndexTest.java
index ae01e5b..ef6cda3 100644
--- a/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchIndexTest.java
+++ b/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchIndexTest.java
@@ -132,7 +132,7 @@ public class ElasticsearchIndexTest extends ElasticsearchBaseTest {
             public void configure() {
                 from("direct:start").to("elasticsearch://local");
                 from("direct:index").to("elasticsearch://local?operation=INDEX&indexName=twitter&indexType=tweet");
-                from("direct:indexWithReplication").to("elasticsearch://local?operation=INDEX&indexName=twitter&indexType=tweet&replicationType=SYNC");
+                from("direct:indexWithReplication").to("elasticsearch://local?operation=INDEX&indexName=twitter&indexType=tweet");
                 from("direct:indexWithWriteConsistency").to("elasticsearch://local?operation=INDEX&indexName=twitter&indexType=tweet&consistencyLevel=ONE");
                 //from("direct:indexWithIp").to("elasticsearch://elasticsearch?operation=INDEX&indexName=twitter&indexType=tweet&ip=localhost");
                 //from("direct:indexWithIpAndPort").to("elasticsearch://elasticsearch?operation=INDEX&indexName=twitter&indexType=tweet&ip=localhost&port=9300");

http://git-wip-us.apache.org/repos/asf/camel/blob/7d86043c/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneConstants.java
----------------------------------------------------------------------
diff --git a/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneConstants.java
b/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneConstants.java
index c4cb57e..3637e6c 100644
--- a/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneConstants.java
+++ b/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneConstants.java
@@ -19,5 +19,5 @@ package org.apache.camel.component.lucene;
 import org.apache.lucene.util.Version;
 
 public interface LuceneConstants {
-    Version LUCENE_VERSION = Version.LUCENE_4_10_4;
+    Version LUCENE_VERSION = Version.LUCENE_5_2_1;
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/7d86043c/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java
----------------------------------------------------------------------
diff --git a/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java
b/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java
index 98ed88d..950fc76 100644
--- a/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java
+++ b/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java
@@ -50,9 +50,9 @@ public class LuceneIndexer {
             if (!indexDirectory.exists()) {
                 indexDirectory.mkdir();
             }   
-            this.setNiofsDirectory(new NIOFSDirectory(indexDirectory));
+            this.setNiofsDirectory(new NIOFSDirectory(indexDirectory.toPath()));
         } else {
-            this.setNiofsDirectory(new NIOFSDirectory(new File("./indexDirectory")));
+            this.setNiofsDirectory(new NIOFSDirectory(new File("./indexDirectory").toPath()));
         }
 
         this.setAnalyzer(analyzer);
@@ -143,7 +143,7 @@ public class LuceneIndexer {
     private void openIndexWriter() throws IOException {
         IndexWriterConfig indexWriterConfig;
         // use create or append so we can reuse existing index if already exists
-        indexWriterConfig = new IndexWriterConfig(LuceneConstants.LUCENE_VERSION, getAnalyzer()).setOpenMode(OpenMode.CREATE_OR_APPEND);
+        indexWriterConfig = new IndexWriterConfig(getAnalyzer()).setOpenMode(OpenMode.CREATE_OR_APPEND);
         indexWriter = new IndexWriter(niofsDirectory, indexWriterConfig);
     }
 
@@ -154,7 +154,7 @@ public class LuceneIndexer {
 
     private static FieldType createFieldType(boolean tokenized) {
         FieldType answer = new FieldType();
-        answer.setIndexed(true);
+        //answer.setIndexed(true);
         answer.setStored(true);
         answer.setTokenized(tokenized);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/7d86043c/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneSearcher.java
----------------------------------------------------------------------
diff --git a/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneSearcher.java
b/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneSearcher.java
index 6a7f257..567ee94 100644
--- a/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneSearcher.java
+++ b/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneSearcher.java
@@ -45,9 +45,9 @@ public class LuceneSearcher {
 
     public void open(File indexDirectory, Analyzer analyzer) throws IOException {
         if (indexDirectory != null) {
-            indexReader = DirectoryReader.open(new NIOFSDirectory(indexDirectory));
+            indexReader = DirectoryReader.open(new NIOFSDirectory(indexDirectory.toPath()));
         } else {
-            indexReader = DirectoryReader.open(new NIOFSDirectory(new File("./indexDirectory")));
+            indexReader = DirectoryReader.open(new NIOFSDirectory(new File("./indexDirectory").toPath()));
         }
         indexSearcher = new IndexSearcher(indexReader);
         this.analyzer = analyzer;
@@ -88,7 +88,7 @@ public class LuceneSearcher {
 
         QueryParser parser = new QueryParser("contents", analyzer);
         Query query = parser.parse(searchPhrase);
-        TopScoreDocCollector collector = TopScoreDocCollector.create(maxNumberOfHits, true);
+        TopScoreDocCollector collector = TopScoreDocCollector.create(maxNumberOfHits);
         indexSearcher.search(query, collector);
         hits = collector.topDocs().scoreDocs;
         

http://git-wip-us.apache.org/repos/asf/camel/blob/7d86043c/components/camel-solr/src/test/resources/solr/collection1/core.properties
----------------------------------------------------------------------
diff --git a/components/camel-solr/src/test/resources/solr/collection1/core.properties b/components/camel-solr/src/test/resources/solr/collection1/core.properties
index bc0cf7d..bf6d017 100644
--- a/components/camel-solr/src/test/resources/solr/collection1/core.properties
+++ b/components/camel-solr/src/test/resources/solr/collection1/core.properties
@@ -1 +1 @@
-name=collection1
\ No newline at end of file
+name=collection1

http://git-wip-us.apache.org/repos/asf/camel/blob/7d86043c/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index ba10216..47c2fab 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -144,8 +144,8 @@
     <ehcache-version>2.10.1</ehcache-version>
     <egit-github-core-version>2.1.5</egit-github-core-version>
     <egit-github-core-bundle-version>2.1.5_1</egit-github-core-bundle-version>
-    <elasticsearch-bundle-version>1.7.3_1</elasticsearch-bundle-version>
-    <elasticsearch-version>1.7.3</elasticsearch-version>
+    <elasticsearch-bundle-version>2.0.0_1</elasticsearch-bundle-version>
+    <elasticsearch-version>2.0.0</elasticsearch-version>
     <elsql-version>1.2</elsql-version>
     <el-api-1.0-version>1.0.1</el-api-1.0-version>
     <embedmongo-version>1.50.0</embedmongo-version>
@@ -338,8 +338,8 @@
     <logback-version>1.1.3</logback-version>
     <lucene3-bundle-version>3.6.0_1</lucene3-bundle-version>
     <lucene3-version>3.6.0</lucene3-version>
-    <lucene-bundle-version>4.10.4_1</lucene-bundle-version>
-    <lucene-version>4.10.4</lucene-version>
+    <lucene-bundle-version>5.2.1_1</lucene-bundle-version>
+    <lucene-version>5.2.1</lucene-version>
     <lucene-version-range>[4.5,5)</lucene-version-range>
     <lightcouch-version>0.1.8</lightcouch-version>
     <lightcouch-bundle-version>0.1.8_2</lightcouch-bundle-version>


Mime
View raw message