当前位置:   article > 正文

【elasticsearch】批量更新数据_es批量更新

es批量更新

软件版本:

  • php 5.6.31
  • elasticsearch 6.1.1
  • Yii 2 框架

elasticsearch 扩展:

{
    "require": {
        "elasticsearch/elasticsearch": "~5.0"
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5

代码:

function actionArticle()
{
   
    $open_sites = Yii::$app->getDb()->createCommand(
        "select indicator from {
   {%site}} where status = 1 order by id asc"
    )->queryAll();
    if (empty($open_sites)) {
   
        return 0;
    }

    foreach ($open_sites as $open_site) {
   
        $indicator
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/699082
推荐阅读
相关标签
  

闽ICP备14008679号