at the end of the day, it was inevitable

This commit is contained in:
Mo Elzubeir
2022-12-09 08:36:26 -06:00
commit 1218570914
1768 changed files with 887087 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
$file = file_get_contents('test-twitter.json');
$array = json_decode($file, true);
exec('mkdir jsons');
foreach ($array as $k => $item) {
echo $k . PHP_EOL;
$result = $item['_source'];
file_put_contents('jsons/'.$k.'.json', json_encode($result));
exec('curl -XPOST http://socialhose-elastic:9200/external/document -H "Content-Type: application/json" -d @jsons/'. $k.'.json');
}
exec('rm -r jsons');
$file = file_get_contents('test-instagram.json');
$array = json_decode($file, true);
exec('mkdir jsons');
foreach ($array as $k => $item) {
echo $k . PHP_EOL;
$result = $item['_source'];
file_put_contents('jsons/'.$k.'.json', json_encode($result));
exec('curl -XPOST http://socialhose-elastic:9200/external/document -H "Content-Type: application/json" -d @jsons/'. $k.'.json');
}
exec('rm -r jsons');
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
php add-fixtures.php
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff