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
- install ES and run local instance (instructions)
- configure transport client (Config.class)
- 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"}' |
- run ElasticsearchOperationsTest.java