Skip to content

This is Maven project. It describes Basic CRUD operation on ElasticSearch using java transport client.

Notifications You must be signed in to change notification settings

satendrakumar/es-java-client-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

es-java-client-sample

Prerequisite : Java 8 and Later version

Start ElasticSearch

  1. Download elasticsearch from here
  2. Extract downloaded elasticsearch
  3. cd elasticsearch-X.X.X
  4. $ bin/elasticsearch

Insert data into elasticsearch

 $ curl -H "Content-Type:application/json" -XPOST localhost:9200/test/tweet   -d '{"name":"Satendra", "job":"consultant" , "location":"India", "age":28}'
 $ curl -H "Content-Type:application/json" -XPOST localhost:9200/test/tweet   -d '{"name":"Rohit", "job":"consultant" , "location":"India", "age":22}'
 $ curl -H "Content-Type:application/json" -XPOST localhost:9200/test/tweet   -d '{"name":"Mohit", "job":"consultant" , "location":"India", "age":25}'

Run project

$ mvn package
$ mvn exec:java -Dexec.mainClass="com.es.app.ESApp"

About

This is Maven project. It describes Basic CRUD operation on ElasticSearch using java transport client.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages