当前位置: 首页>>代码示例>>PHP>>正文


PHP Client::count方法代码示例

本文整理汇总了PHP中Elasticsearch\Client::count方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::count方法的具体用法?PHP Client::count怎么用?PHP Client::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Elasticsearch\Client的用法示例。


在下文中一共展示了Client::count方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * @Route("/")
  * @Template("DashboardMainBundle:Default:index.html.twig")
  */
 public function index()
 {
     $params = array();
     $params['hosts'] = array('127.0.0.1:9200');
     $client = new Elasticsearch\Client($params);
     $params = array("index" => "dash-mail-*", "type" => "mail", "body" => array("query" => array("filtered" => array("filter" => array("bool" => array("must" => array(array("missing" => array("field" => "flags")), array("term" => array("folderFullName" => "INBOX")))))))));
     $results_mail = $client->search($params);
     $params = array("index" => "dash-rss-*", "type" => "page");
     $results_rss = $client->count($params);
     $params = array("index" => "dash-twitter-*", "type" => "status");
     $results_twitter = $client->count($params);
     return array("mail_unread" => $results_mail['hits']['total'], "rss_total" => $results_rss['count'], "twitter_total" => $results_twitter['count']);
 }
开发者ID:baptistedonaux,项目名称:dashboard,代码行数:17,代码来源:DefaultController.php

示例2: count

 public function count($params = [])
 {
     if (!isset($params['index'])) {
         $params['index'] = $this->getSearchIndex();
     }
     $this->requestToScreen($params, 'COUNT');
     try {
         return parent::count($params);
     } catch (\Exception $e) {
         $this->registerErrorForException($e);
         return array();
     }
 }
开发者ID:ColdTrick,项目名称:elasticsearch,代码行数:13,代码来源:Client.php

示例3: count

 /**
  * Returns the number of entities available.
  * @return integer the number of entities
  */
 public function count()
 {
     $result = $this->elasticsearchClient->count(array('index' => $this->index, 'type' => $this->getType()));
     return $result['count'];
 }
开发者ID:aboutyou,项目名称:ayoc-persistence-elasticsearch,代码行数:9,代码来源:ElasticsearchCrudRepository.php

示例4: jobsCount

 public function jobsCount(array $criteria, ElasticsearchClient $client, array $config)
 {
     $exportOptions = $this->buildExportOptions($criteria);
     $component = 'orchestrator';
     $filter = [];
     $filter[] = ['term' => ['project.id' => $this->token->getProjectId()]];
     $query = ['match_all' => []];
     if ($exportOptions != null) {
         $query = ['query_string' => ['allow_leading_wildcard' => 'false', 'default_operator' => 'AND', 'query' => $exportOptions]];
     }
     $params = [];
     $params['index'] = $config['index_prefix'] . '_syrup_*';
     if (!is_null($component)) {
         $params['index'] = $config['index_prefix'] . '_syrup_' . $component;
     }
     $params['body'] = ['query' => ['filtered' => ['filter' => ['bool' => ['must' => $filter]], 'query' => $query]]];
     $count = $client->count($params);
     return $count['count'];
 }
开发者ID:keboola,项目名称:orchestrator-bundle,代码行数:19,代码来源:JobManager.php


注:本文中的Elasticsearch\Client::count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。