Skip to content

How to start with spring data elasticsearch

akonczak edited this page Aug 27, 2013 · 9 revisions

First thing you will need to answer to yourself how you will use this framework.

    1. Case 1: I need only index and search documents in my project. Quick start: First add to your pom.xml file information about snapshot repository for spring-data-elasticsearch
<repositories>
    <repository>
        <id>spring-snapshot</id>
        <name>Spring Maven SNAPSHOT Repository</name>
        <url>http://repo.springsource.org/libs-snapshot</url>
    </repository>
<repositories>

Second add dependency for spring-data-elasticsearch

<dependencies>
...
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-elasticsearch</artifactId>
        <version>1.0.0.BUILD-SNAPSHOT</version>
    </dependency> 
...
</dependencies>

Having both entries in the pom file you should be able to use spring-data-elasticsearch without any issues.

    1. Case 2: I have a plane to develop new feature/ or extend existing ones. Quick start: