Github user sweetest commented on a diff in the pull request: https://github.com/apache/storm/pull/679#discussion_r37155605 --- Diff: external/storm-elasticsearch/README.md --- @@ -6,37 +6,75 @@ ## EsIndexBolt (org.apache.storm.elasticsearch.bolt.EsIndexBolt) EsIndexBolt streams tuples directly into Elasticsearch. Tuples are indexed in specified index & type combination. -User should make sure that there are "source", "index","type", and "id" fields declared in preceding bolts or spout. -"index" and "type" fields are used for identifying target index and type. +Users should make sure that ```EsTupleMapper``` can extract "source", "index", "type", and "id" from input tuple. +"index" and "type" are used for identifying target index and type. "source" is a document in JSON format string that will be indexed in Elasticsearch. ```java +class SampleEsTupleMapper implements EsTupleMapper { + @Override + public String getSource(ITuple tuple) { + return tuple.getStringByField("source"); + } + + @Override + public String getIndex(ITuple tuple) { + return tuple.getStringByField("index"); + } + + @Override + public String getType(ITuple tuple) { + return tuple.getStringByField("type"); + } + + @Override + public String getId(ITuple tuple) { + return tuple.getStringByField("id"); + } +} + --- End diff -- How about naming this module as "DefaultEsTupleMapper"?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---