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


PHP AbstractQuery::toArray方法代码示例

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


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

示例1: toArray

 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     $array = parent::toArray();
     if (isset($array['script'])) {
         $array['script'] = $array['script']['script'];
     }
     return $array;
 }
开发者ID:makeandship,项目名称:wordpress-fantastic-elasticsearch,代码行数:11,代码来源:Script.php

示例2: toArray

 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     $array = parent::toArray();
     $baseName = $this->_getBaseName();
     if (isset($array[$baseName]['query'])) {
         $array[$baseName]['query'] = $array[$baseName]['query']['query'];
     }
     return $array;
 }
开发者ID:ruflin,项目名称:elastica,代码行数:12,代码来源:HasChild.php

示例3: toArray

 /**
  * @return array
  */
 public function toArray()
 {
     $array = parent::toArray();
     // if there are no params, it's ok, but ES will throw exception if json
     // will be like {"top_hits":[]} instead of {"top_hits":{}}
     if (empty($array['inner_hits'])) {
         $array['inner_hits'] = new \stdClass();
     }
     return $array['inner_hits'];
 }
开发者ID:ruflin,项目名称:elastica,代码行数:13,代码来源:InnerHits.php

示例4: toArray

 /**
  * @return array
  */
 public function toArray()
 {
     if (sizeof($this->_functions)) {
         $this->setParam('functions', $this->_functions);
     }
     return parent::toArray();
 }
开发者ID:viz,项目名称:wordpress-fantastic-elasticsearch,代码行数:10,代码来源:FunctionScore.php

示例5: toArray

 /**
  * Converts query to array
  *
  * @return array Query array
  * @see \Elastica\Query\AbstractQuery::toArray()
  */
 public function toArray()
 {
     $this->setParam($this->_field, array('query' => $this->_queryString));
     return parent::toArray();
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:11,代码来源:Field.php

示例6: setQuery

 /**
  * Sets nested query.
  *
  * @param \Elastica\Query\AbstractQuery $query
  *
  * @return $this
  */
 public function setQuery(AbstractQuery $query)
 {
     return $this->setParam('query', $query->toArray());
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:11,代码来源:Nested.php

示例7: toArray

 public function toArray()
 {
     $array = parent::toArray();
     // If _id is provided, perform MLT on an existing document from the index
     // If _source is provided, perform MLT on a document provided as an input
     if (!empty($array['more_like_this']['like']['_id'])) {
         $doc = $array['more_like_this']['like'];
         $doc = array_intersect_key($doc, array('_index' => 1, '_type' => 1, '_id' => 1));
         $array['more_like_this']['like'] = $doc;
     } elseif (!empty($array['more_like_this']['like']['_source'])) {
         $doc = $array['more_like_this']['like'];
         $doc['doc'] = $array['more_like_this']['like']['_source'];
         unset($doc['_id']);
         unset($doc['_source']);
         $array['more_like_this']['like'] = $doc;
     }
     return $array;
 }
开发者ID:makeandship,项目名称:wordpress-fantastic-elasticsearch,代码行数:18,代码来源:MoreLikeThis.php

示例8: setNegativeQuery

 /**
  * Set the negative query for this Boosting Query
  * @param AbstractQuery $query
  * @return \Elastica\Query\Boosting
  */
 public function setNegativeQuery(AbstractQuery $query)
 {
     return $this->setParam('negative', $query->toArray());
 }
开发者ID:viz,项目名称:wordpress-fantastic-elasticsearch,代码行数:9,代码来源:Boosting.php

示例9: toArray

 /**
  * @see \Elastica\Param::toArray()
  *
  * @throws \Elastica\Exception\InvalidException
  *
  * @return array
  */
 public function toArray()
 {
     $this->setParam($this->_key, $this->_getLocationData());
     return parent::toArray();
 }
开发者ID:vinusebastian,项目名称:Elastica,代码行数:12,代码来源:AbstractGeoDistance.php

示例10: toArray

 /**
  * @return array
  */
 public function toArray()
 {
     $this->setParam($this->_field, $this->_queryParams);
     return parent::toArray();
 }
开发者ID:makeandship,项目名称:wordpress-fantastic-elasticsearch,代码行数:8,代码来源:Common.php

示例11: toArray

 /**
  * Converts fuzzy like this query to array.
  *
  * @return array Query array
  *
  * @see \Elastica\Query\AbstractQuery::toArray()
  */
 public function toArray()
 {
     if (!empty($this->_fields)) {
         $args['fields'] = $this->_fields;
     }
     if (!empty($this->_boost)) {
         $args['boost'] = $this->_boost;
     }
     if (!empty($this->_analyzer)) {
         $args['analyzer'] = $this->_analyzer;
     }
     $args['min_similarity'] = $this->_minSimilarity > 0 ? $this->_minSimilarity : 0;
     $args['like_text'] = $this->_likeText;
     $args['prefix_length'] = $this->_prefixLength;
     $args['ignore_tf'] = $this->_ignoreTF;
     $args['max_query_terms'] = $this->_maxQueryTerms;
     $data = parent::toArray();
     $args = array_merge($args, $data['fuzzy_like_this']);
     return array('fuzzy_like_this' => $args);
 }
开发者ID:MediaWiki-stable,项目名称:1.26.0,代码行数:27,代码来源:FuzzyLikeThis.php

示例12: toArray

 /**
  * Converts array to an object in case no queries are added.
  *
  * @return array
  */
 public function toArray()
 {
     if (empty($this->_params)) {
         $this->_params = new \stdClass();
     }
     return parent::toArray();
 }
开发者ID:davidLv,项目名称:Elastica,代码行数:12,代码来源:BoolQuery.php

示例13: toArray

 public function toArray()
 {
     $array = parent::toArray();
     if (isset($array['more_like_this']['like']['_id'])) {
         $doc = $array['more_like_this']['like'];
         $doc = array_intersect_key($doc, array('_index' => 1, '_type' => 1, '_id' => 1));
         $array['more_like_this']['like'] = $doc;
     }
     return $array;
 }
开发者ID:davidLv,项目名称:Elastica,代码行数:10,代码来源:MoreLikeThis.php

示例14: toArray

 /**
  * Converts the terms object to an array.
  *
  * @see \Elastica\Query\AbstractQuery::toArray()
  *
  * @throws \Elastica\Exception\InvalidException If term key is empty
  *
  * @return array Query array
  */
 public function toArray()
 {
     if (empty($this->_key)) {
         throw new InvalidException('Terms key has to be set');
     }
     $this->setParam($this->_key, $this->_terms);
     return parent::toArray();
 }
开发者ID:zhangxiaoliu,项目名称:Elastica,代码行数:17,代码来源:Terms.php


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