Hi,
I'm new to ElasticSearch and Lucene (2 weeks) and especially to maven
(yesterday). I am writing java proof of concept to learn how to use
ES. I was successful in writing Apache Http Client and Jersey clients
to communicate with ES. The two clients were developed in maven. Now,
I am trying to replicate the effort using the native ES java client
but I am having trouble downloading the ES jars so I can use them to
build my ES java client.
My POM (shown at the end) is having trouble parsing:
org.elasticsearch
elasticsearch
0.17.2
As you can see, I tried both 0.16.0 and 0.17.2 to no avail. Can you
please help/show me how to update my pom in order to get the client to
build on maven.
On a related note, the primary aim of this POC is to figure out how to
access the ES POJOs for both the request and response. In other words,
so far, I have been exchanging JSONs between Jersey and ES.
Consequently, I had to write my own java POJO, and using jackson, to
convert the returned JSON (from ES rest api) to POJO. I found that to
be cumbersome.
Given the following JSON, my guess is that there should be a mapped
POJO in the public ES API
{
"query": {
"filtered" : {
"query" : {
"query_string" : {
"query" : "some query string here"
}
},
"filter" : {
"term" : { "user" : "kimchy" }
}
}
}
}
And conversely, the result set JSON should have it's own public POJO.
Without these public POJOs, I will have to write dozens of POJOs to
represent the various request and response JSONS.
I my guess correct? If so, can you provide me with the package path.
Thank you for taking the time to help me with these two problems.
============================================================
4.0.0
maven2-repository.java.net
Java.net Repository for Maven
http://download.java.net/maven/2/
default
maven-repository.java.net
Java.net Maven 1 Repository (legacy)
http://download.java.net/maven/1
legacy
oss.sonatype.org
OSS Sonatype
true
false
https://oss.sonatype.org/content/repositories/
releases/
sonatype-snapshots
Sonatype Snapshots Repository
http://oss.sonatype.org/content/repositories/
snapshots/
true
com.example.es
es
1.0-SNAPSHOT
es
http://maven.apache.org
org.apache.maven.plugins
maven-compiler-plugin
2.3.2
1.6
1.6
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</
descriptorRef>
com.example.es.apachehttpclient.Delete
com.example.es.apachehttpclient.Index
com.example.es.apachehttpclient.Search
com.example.es.jersey.Search</
mainClass>
<dependencies>
<!-- Start ElasticSearch Dependencies -->
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>0.16.0</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-snowball</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-fast-vector-highlighter</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-highlighter</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queries</artifactId>
<version>2.4.0</version>
</dependency>
<!-- End ElasticSearch Dependencies -->
<!-- Start Jersey Dependencies -->
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-apache-client</artifactId>
<version>1.8</version>
</dependency>
<!-- End Jersey Dependencies -->
<!-- Start Apache Http Client Dependencies -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.1.1</version>
</dependency>
<!-- End Apache Http Client Dependencies -->
<!-- Start JUNIT Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
<scope>test</scope>
</dependency>
<!-- End JUNIT Dependencies -->
</dependencies>