Elasticsearch Client

Hi there!

I'm have a java application accessing ES. I'm having trouble with the latest elasticsearch-2.3.x.jar files. My questions:

  1. Why does the maven artifact

    org.elasticsearch elasticsearch 2.3.2

have such different dependencies as the former 2.3.1 version?

  1. I.e., why is it using an older Lucene Version 4.10.4, while 2.3.1 was using 5.5.0

That makes 2.3.1 quite incompatible with 2.3.2.

  1. Why does the client require lucene in the first place?

    Caused by: java.lang.ClassNotFoundException: org.apache.lucene.util.Version
    at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_60]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_60]
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[?:1.8.0_60]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_60]
    at org.elasticsearch.Version.(Version.java:44) ~[elasticsearch-2.3.1.jar:2.3.1]
    at org.elasticsearch.client.transport.TransportClient$Builder.build(TransportClient.java:129) ~[elasticsearch-2.3.1.jar:2.3.1]

I would have assumed that the client does not need all the backend engine dependencies.

Thanks for any backgrounds or feedback,

Karsten

2.3.1 is using Lucene 5.5.0. See https://github.com/elastic/elasticsearch/blob/v2.3.1/pom.xml#L47

True, But 2.3.1 uses 4.10.4. Why I did't investigate. I did an independent pom and had a look at the transitive deps:

pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
<modelVersion>4.0.0</modelVersion>
<groupId>x</groupId>
<artifactId>y</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>z</name>
<description>z</description>
<dependencies>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>2.3.2</version>
</dependency>
</dependencies>
</project>

produces with mvn dependency:tree:

[INFO] x:y:jar:0.0.1-SNAPSHOT
[INFO] \- org.elasticsearch:elasticsearch:jar:2.3.2:compile
[INFO]    +- org.apache.lucene:lucene-core:jar:4.10.4:compile
[INFO]    +- org.apache.lucene:lucene-analyzers-common:jar:4.10.4:compile
[INFO]    +- org.apache.lucene:lucene-queries:jar:4.10.4:compile
[INFO]    +- org.apache.lucene:lucene-memory:jar:4.10.4:compile
[INFO]    +- org.apache.lucene:lucene-highlighter:jar:4.10.4:compile
[INFO]    +- org.apache.lucene:lucene-queryparser:jar:4.10.4:compile
[INFO]    +- org.apache.lucene:lucene-sandbox:jar:4.10.4:compile
[INFO]    +- org.apache.lucene:lucene-suggest:jar:4.10.4:compile
[INFO]    +- org.apache.lucene:lucene-misc:jar:4.10.4:compile
[INFO]    +- org.apache.lucene:lucene-join:jar:4.10.4:compile
[INFO]    +- org.apache.lucene:lucene-grouping:jar:4.10.4:compile
[INFO]    +- org.apache.lucene:lucene-spatial:jar:4.10.4:compile
[INFO]    |  \- com.spatial4j:spatial4j:jar:0.4.1:compile
[INFO]    \- org.yaml:snakeyaml:jar:1.12:compile

No. With your pom.xml it gives:

$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building z 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ y ---
[INFO] x:y:jar:0.0.1-SNAPSHOT
[INFO] \- org.elasticsearch:elasticsearch:jar:2.3.2:compile
[INFO]    +- org.apache.lucene:lucene-core:jar:5.5.0:compile
[INFO]    +- org.apache.lucene:lucene-backward-codecs:jar:5.5.0:compile
[INFO]    +- org.apache.lucene:lucene-analyzers-common:jar:5.5.0:compile
[INFO]    +- org.apache.lucene:lucene-queries:jar:5.5.0:compile
[INFO]    +- org.apache.lucene:lucene-memory:jar:5.5.0:compile
[INFO]    +- org.apache.lucene:lucene-highlighter:jar:5.5.0:compile
[INFO]    +- org.apache.lucene:lucene-queryparser:jar:5.5.0:compile
[INFO]    |  \- org.apache.lucene:lucene-sandbox:jar:5.5.0:compile
[INFO]    +- org.apache.lucene:lucene-suggest:jar:5.5.0:compile
[INFO]    |  \- org.apache.lucene:lucene-misc:jar:5.5.0:compile
[INFO]    +- org.apache.lucene:lucene-join:jar:5.5.0:compile
[INFO]    |  \- org.apache.lucene:lucene-grouping:jar:5.5.0:compile
[INFO]    +- org.apache.lucene:lucene-spatial:jar:5.5.0:compile
[INFO]    |  +- org.apache.lucene:lucene-spatial3d:jar:5.5.0:compile
[INFO]    |  \- com.spatial4j:spatial4j:jar:0.5:compile
[INFO]    +- com.google.guava:guava:jar:18.0:compile
[INFO]    +- org.elasticsearch:securesm:jar:1.0:compile
[INFO]    +- com.carrotsearch:hppc:jar:0.7.1:compile
[INFO]    +- joda-time:joda-time:jar:2.8.2:compile
[INFO]    +- org.joda:joda-convert:jar:1.2:compile
[INFO]    +- com.fasterxml.jackson.core:jackson-core:jar:2.6.2:compile
[INFO]    +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.6.2:compile
[INFO]    +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.6.2:compile
[INFO]    |  \- org.yaml:snakeyaml:jar:1.15:compile
[INFO]    +- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.6.2:compile
[INFO]    +- io.netty:netty:jar:3.10.5.Final:compile
[INFO]    +- com.ning:compress-lzf:jar:1.0.2:compile
[INFO]    +- com.tdunning:t-digest:jar:3.0:compile
[INFO]    +- org.hdrhistogram:HdrHistogram:jar:2.1.6:compile
[INFO]    +- commons-cli:commons-cli:jar:1.3.1:compile
[INFO]    \- com.twitter:jsr166e:jar:1.1.0:compile

You have something wrong on your side.

Thank you. I will investigate.