Can't configure JAVA API for elastic search

I used elastic search across nodes. But now for a java application I need elasticsearch. So I read the documentation on the official search site. But I cannot follow one thing.

I have installed Maven plugin in Eclipse. I have done the dependency setup in the pom.xml in my project.

  <dependencies>
    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>1.5.0</version>
    </dependency>
  </dependencies>

      

But whenever I write below line in java it says no permission is possible.

import static org.elasticsearch.node.NodeBuilder.*;

      

Thus, I cannot use elastic search in java.

I read this as source

https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/index.html

http://java.dzone.com/articles/elasticsearch-java-api

+3


source to share


1 answer


I'm not sure what you are doing here, you don't have to download the jar manually and add to eclipse as a project dependency. Read this tutorial to understand how maven dependency works. Relevant text below:



Maven connects to remote repositories (or you can set up your own local repositories) and automatically downloads all the dependencies needed to build your project. For example, let's say you have a project that uses the Apache Camel routing tool, version 2.10.6, but a new version of Camel has been released, 2.11.1. Instead of going to the Apache website download the 2.11.1 distribution and replace 2.10.6 with that you can just tell Maven to use the new distribution and the job is done for you.

0


source







All Articles