[GitHub] flink issue #2790: [FLINK-4491] Handle index.number_of_shards in the ES conn...

2016-12-01 Thread ddolzan
Github user ddolzan commented on the issue:

https://github.com/apache/flink/pull/2790
  
Index template and index mapping creation/configuration will be kept 
outside of flink.
An example on how to do it can be found on 
https://github.com/okkam-it/flink-examples.


---
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.
---


[GitHub] flink pull request #2790: [FLINK-4491] Handle index.number_of_shards in the ...

2016-12-01 Thread ddolzan
Github user ddolzan closed the pull request at:

https://github.com/apache/flink/pull/2790


---
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.
---


[GitHub] flink pull request #2790: [FLINK-4491] Handle index.number_of_shards in the ...

2016-11-11 Thread ddolzan
GitHub user ddolzan opened a pull request:

https://github.com/apache/flink/pull/2790

[FLINK-4491] Handle index.number_of_shards in the ES connector

Implemented the Index Template and Index Mapping creation. 
Number of shards and many other properties can be defined in the Index 
Template.

### Usage
Before calling ElasticasearchSink instantiate ElasticSearchHelper

```java
ElasticSearchHelper esHelper = new ElasticSearchHelper(config, transports);
//Create an Index Template given a name and the json structure
esHelper.initTemplate(templateName, templateRequest);
//Create an Index Mapping given the Index Name, DocType and the json 
structure
esHelper.initIndexMapping(indexName, docType, mappingsRequest);
```

### TemplateRequest example
```json
{
  "template": "te*",
  "settings": {
"number_of_shards": 1
  },
  "mappings": {
"type1": {
  "_source": {
"enabled": false
  },
  "properties": {
"host_name": {
  "type": "keyword"
},
"created_at": {
  "type": "date",
  "format": "EEE MMM dd HH:mm:ss Z "
}
  }
}
  }
}
```
### MappingRequest example
```json
{
  "mappings": {
"user": {
  "_all": {
"enabled": false
  },
  "properties": {
"title": {
  "type": "string"
},
"name": {
  "type": "string"
},
"age": {
  "type": "integer"
}
  }
}
  }
}
```





You can merge this pull request into a Git repository by running:

$ git pull https://github.com/ddolzan/flink issue-4491

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/flink/pull/2790.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2790


commit bae4237b755c1522a026ec691388ec8c197e8ab8
Author: ddolzan <dol...@okkam.it>
Date:   2016-11-11T15:21:05Z

[FLINK-4491] Added index template and mappings creation




---
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.
---