demo_document.php 380 B

123456789101112
  1. <?php
  2. require_once("Config.inc.php");
  3. use OpenSearch\Client\DocumentClient;
  4. $tableName = 'main';
  5. $documentClient = new DocumentClient($client);
  6. $json = json_encode(array(array("cmd" => "add", "fields" => array("hid" => 1, "ota_hid" => 11111))));
  7. $ret = $documentClient->push($json, $appName, $tableName);
  8. print_r(json_decode($ret->result, true));
  9. echo $ret->traceInfo->tracer;