Giter VIP home page Giter VIP logo

spring-boot-standalone-elasticsearch's Introduction

Overview

In this project, We will show how Spring boot can intract with Elasticsearch Engine using TransportClient. This project uses elasticsearch client jar 5.0.0 version with ElasticSearch Engine 5.5.0. Don't use ElasticSearch 5.x and above with spring-data-elasticsearch as it is not updated yet with If you want to see how spring-data-elasticsearch interact with Elasticsearch Engine, check this blog for details -https://www.rajeshbhojwani.co.in/2018/12/overview-elasticsearch-real-time.html

Step 1 Download the code from github

git clone https://github.com/RajeshBhojwani/spring-boot-standalone-elasticsearch.git

Step 2 Build the project

mvn clean install

Step 3 Launch the application

java -jar target\standalone-elasticsearch-0.0.1-SNAPSHOT.jar

Step 4 Use Curl or Postman to test the REST apis created.

APIs for ElastisearchTemplate usage

  1. POST call for creating new Index "users", type "employee" and document. http://localhost:8102/rest/users/create

JSON data

{
  "userId":"1",
  "name": "Sumit",
   "userSettings": {
   	"gender" : "male",
   	"occupation" : "CA",
   	"hobby" : "chess"
   }
}
  1. GET call to retrive particular User with id.

http://localhost:8102/rest/users/view/1

  1. update field of the document by user id. http://localhost:8102/rest/users/update/1

  2. delete field of the document by user id. http://localhost:8102/rest/users/delete/1

For detail explanation of this project check this blog - https://www.rajeshbhojwani.co.in/2018/12/spring-boot-elasticsearch.html

spring-boot-standalone-elasticsearch's People

Contributors

rajeshbhojwani avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.