<?php
ini_set("display_errors", "On");//打开错误提示
ini_set("error_reporting", E_ALL);//显示所有错误
/*
 * cli入口脚本
 * cli 配置文件：conf/cli.ini
 * cli bootstrap：application/BootstrapCli.php ( 在cli.ini中配置
 * 默认模块：modules/cli
 * 脚本位置：modules/cli/controllers/xxx.php
 * 调用方式：php cli.php controller action "a=1&b=2"
 * 测试脚本：php cli.php test index "a=1&b=2"
 */
if (!substr(php_sapi_name(), 0, 3) == 'cli') {
    die;
}

define('APPLICATION_PATH', realpath(__DIR__ . '/../'));
require APPLICATION_PATH . '/vendor/autoload.php';
$application = new Yaf\Application(APPLICATION_PATH . "/conf/cli.ini");

$es = new \App\Services\demo\ElasticService();
//$es->createIndex();

//$es->getSettings();
//$es->putSettings();
//$es->getSettings();

//$es->getMapping();
//$es->putMapping();
//$es->getMapping();

//$es->indexDoc();
//$es->bulk();
//$es->searchDoc();

//$es->updateDoc();
//$es->getDoc();
//$es->deleteDoc();

//$es->deleteIndex();