Skip to content

Commit

Permalink
chore: update test script
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Feb 15, 2019
1 parent 7389366 commit 7354a3e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion test.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
];

$client = new Ahc\Plastic\Client(true);
$client = new Ahc\Plastic\Client(null, true);

foreach ($schools as $school) {
$id = (string) $school['id'];
Expand All @@ -26,3 +26,20 @@
// find a school by id
echo $client->get->schools->school->$id();
}

echo $client->put->_cluster->settings([
'persistent' => ['action.auto_create_index' => 'true'],
]);

$school3 = [
'id' => '3',
'name' => 'City School 3',
'addr' => 'City 3, Street 3, Province 3, Country 3',
'tags' => ['school', '3'],
];

// Create using put
echo $client->put->schools->school->_3($school3, ['op_type' => 'create']);

// Get only source
echo $client->get->schools->school->_3->_source();

0 comments on commit 7354a3e

Please sign in to comment.