Skip to content

Commit f36f592

Browse files
committed
Support flux options via setters in JsonToElasticsearchBulk
For flux usage like: `json-to-elasticsearch-bulk(idKey="id",type="oerbw",index="oersi")`
1 parent a5c534f commit f36f592

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

metafacture-elasticsearch/src/main/java/org/metafacture/elasticsearch/JsonToElasticsearchBulk.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,25 @@ public Object put(String key, Object value) {
7878
private String type;
7979
private String index;
8080

81+
public void setIdKey(String idKey) {
82+
this.idPath = new String[]{idKey};
83+
}
84+
85+
public void setType(String type) {
86+
this.type = type;
87+
}
88+
89+
public void setIndex(String index) {
90+
this.index = index;
91+
}
92+
93+
public JsonToElasticsearchBulk() {
94+
super();
95+
this.idPath = new String[]{};
96+
this.type = null;
97+
this.index = null;
98+
}
99+
81100
/**
82101
* As an id is not required it can be omitted.
83102
*

0 commit comments

Comments
 (0)