From c1172cf95d7f2e91823927bdd35bdacb39310658 Mon Sep 17 00:00:00 2001 From: Hasnain Javed Date: Tue, 8 Jul 2014 11:43:20 +0500 Subject: [PATCH] BATCH-2267: fixed formatting of README.md --- spring-batch-elasticsearch/README.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/spring-batch-elasticsearch/README.md b/spring-batch-elasticsearch/README.md index b715700..8ce3e38 100644 --- a/spring-batch-elasticsearch/README.md +++ b/spring-batch-elasticsearch/README.md @@ -1,16 +1,19 @@ # spring-batch-elasticsearch - +-------------- ItemReader and ItemWriter implementations for Elasticsearch -## To index a document via ElasticsearchItemWriter - +## To index documents +-------------- +Create a class and define the index name and type +``` @Document(indexName="some_index", type="some_type") public class SomeClass { // field(s) with getter(s) and setter(s) } +``` Create an item processor - +``` public class SampleItemProcess implements ItemProcessor { @Override @@ -26,9 +29,11 @@ public class SampleItemProcess implements ItemProcessor { return builder.build(); } } +``` -## Configuration for reading/writing documents from/to Elasticsearch - +## Configuration for reader/writer +-------------- +``` @Configuration public class ReaderWriterConfig { @@ -58,6 +63,7 @@ public class ReaderWriterConfig { // configure and return elastic search template } } +``` ##### NOTE The Pageable object from the Query object will be used for paged requests. Setting the page and pageSize fields (inherited from AbstractPaginatedDataItemReader) will have no effect. \ No newline at end of file