Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     $array = parent::toArray();
     $baseName = $this->_getBaseName();
     if (isset($array[$baseName]['query'])) {
         $array[$baseName]['query'] = $array[$baseName]['query']['query'];
     }
     return $array;
 }
Пример #2
0
 /**
  * @see \Elastica\Param::toArray()
  *
  * @return array
  */
 public function toArray()
 {
     $data = parent::toArray();
     $name = $this->_getBaseName();
     $filterData = $data[$name];
     if (empty($filterData)) {
         $filterData = $this->_filters;
     } else {
         $filterData['filters'] = $this->_filters;
     }
     $data[$name] = $filterData;
     return $this->_convertArrayable($data);
 }
Пример #3
0
 /**
  * Set filter
  *
  * @param  \Elastica\Filter\AbstractFilter $filter
  * @return \Elastica\Filter\BoolNot
  */
 public function setFilter(AbstractFilter $filter)
 {
     return $this->setParam('filter', $filter->toArray());
 }
Пример #4
0
 /**
  * Converts object to an array.
  *
  * @see \Elastica\Filter\AbstractFilter::toArray()
  *
  * @return array data array
  */
 public function toArray()
 {
     $this->setParam($this->_field, $this->_prefix);
     return parent::toArray();
 }
Пример #5
0
 /**
  * Converts object to array
  *
  * @see \Elastica\Filter\AbstractFilter::toArray()
  * @return array Filter array
  */
 public function toArray()
 {
     $this->setParams(array_merge($this->getParams(), $this->_fields));
     return parent::toArray();
 }
 /**
  * Converts object to an array.
  *
  * @see \Elastica\Filter\AbstractFilter::toArray()
  *
  * @return array data array
  */
 public function toArray()
 {
     if (count($this->_options) > 0) {
         $options = array('value' => $this->_regexp);
         $options = array_merge($options, $this->_options);
         $this->setParam($this->_field, $options);
     } else {
         $this->setParam($this->_field, $this->_regexp);
     }
     return parent::toArray();
 }
Пример #7
0
 /**
  * Converts object to array
  *
  * @see \Elastica\Filter\AbstractFilter::toArray()
  * @return array Filter array
  */
 public function toArray()
 {
     $this->setParams($this->_fields);
     return parent::toArray();
 }
 /**
  * Set the filter to be applied to docs in indices which do not match those specified in the "indices" parameter
  * @param AbstractFilter $filter
  * @return Indices
  */
 public function setNoMatchFilter(AbstractFilter $filter)
 {
     return $this->setParam('no_match_filter', $filter->toArray());
 }