Skip to content

ElasticsearchTraining/ElasticsearchJavaSample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status Heroku

ElasticsearchJavaSample

This is a sample project to demonstrate the ElasticSearch Java API's. I use this project as part of trainings on ElasticSearch. I have developed the project using Codenvy (IDE), Travis CI (CI-CD), Coveralls (Coverage) and deployed it on Heroku (PaaS).

Project Details:

  • dropwizard v0.8
  • dropwizard-swagger bundle v0.7
  • Java v1.7
  • ElasticSearch Java API v1.7.1
  • Maven v3.2.5

This project has been tested with ElasticSearch Server v1.7.1.

Prerequisites:

  • Git Bash / Client
  • Java v1.7
  • Maven v3.2.5
  • cURL or Postman or similar browser extension

Build Steps:

  • Clone this repository.
  • Ensure the path to Java and Maven are set.
  • Run the command "mvn clean package" from the Elastic-Sample folder.
  • Either use the IDE or execute the built fat JAR. Pass the following program arguements "server local.yaml".
  • Once the application is running, open http://localhost/swagger in the browser. Swagger should appear as shown below.

Swagger

Tips:

  • Run ElasticSearch Server locally. Ensure the cluster.name in elasticsearch.yml is "elasticsearch".
  • Refer the Elasticsearch Samples Gist for scripts to create indices and documents.
  • Install and use the Head plugin in ElasticSearch to view the indices, documents, queries, cluster and node status etc.
  • Update Maven settings to download the dependencies to a local folder on disk (instead of a network folder).
  • If you are behind a firewall, update the proxy settings for Git client and Maven.

Thanks:

About

A Java tutorial using the Dropwizard, Swagger and Elasticsearch Java API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages