Paz1506 / elasticsearch-example

Example application with elasticsearch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status codebeat badge

elasticsearch-example

Example application with elasticsearch

Note: This application is a simple example. It doesn't contains production code, best practices, etc.

Using with local ES cluster

  1. install ES and run local instance (instructions)
  2. configure transport client (Config.class)
  3. create test index 'zps' and several documents, for example:
Add new documents before testing
1 curl -X POST http://localhost:9200/zps/posts/1001 -d '{"title": "Java 8 Optional In Depth", "category":"Java", "published_date":"23-FEB-2017", "author":"Rambabu Posa"}'
2 curl -X POST http://localhost:9200/zps/posts/1002 -d '{"title": "Elastic Search Basics", "category":"ElasticSearch", "published_date":"03-MAR-2017", "author":"Rambabu Posa"}'
3 curl -X POST http://localhost:9200/zps/posts/1003 -d '{"title": "Spring + Spring Data + ElasticSearch", "category":"Spring", "published_date":"11-MAR-2017", "author":"Rambabu Posa"}'
4 curl -X POST http://localhost:9200/zps/posts/1004 -d '{"title": "Spring + Spring Data + ElasticSearch", "category":"Spring Boot", "published_date":"23-MAR-2017", "author":"Rambabu Posa"}'
  1. run ElasticsearchOperationsTest.java

About

Example application with elasticsearch


Languages

Language:Java 100.0%