Commit 2a204dc2 authored by Tobias Steiner's avatar Tobias Steiner
Browse files

Update bulk commands

parent 32d8d381
......@@ -24,7 +24,7 @@ export class ElasticsearchTransformer extends Transform {
/**
* Target index
*/
private index: string = 'geolinker';
private index: string = 'geolinker-new';
/**
* Elastic-search client
......@@ -60,10 +60,12 @@ export class ElasticsearchTransformer extends Transform {
}
private prepareBulk(row) {
const res: any = {
const meta: any = {
index: {
_index: this.index,
_id: row.id,
_type: 'geolinker'} };
const data: any = {
id: row.id,
provider: row.provider,
url: row.url,
......@@ -75,8 +77,7 @@ export class ElasticsearchTransformer extends Transform {
end: row.end,
location: row.location,
modification_date: row.modification_date,
},
};
return `${JSON.stringify(res)}\n`;
return `${JSON.stringify(meta)}${JSON.stringify(data)}`;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment