Skip to content

Commit

Permalink
Merge pull request #959 from ruflin/deprecate-transports
Browse files Browse the repository at this point in the history
Deprecated Transport exceptions and Apply liniting
  • Loading branch information
ruflin committed Oct 18, 2015
2 parents b52415b + 93e148d commit 51eeb9c
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 31 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
All notable changes to this project will be documented in this file based on the [Keep a Changelog](http://keepachangelog.com/) Standard. This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased](https://github.com/ruflin/Elastica/compare/2.3.0...HEAD)
- Filters aggregation: empty name is named bucket #935
- Update elasticsearch dependency to elasticsearch 1.7.3 #957


### Backward Compatibility Breaks

### Bugfixes
- Filters aggregation: empty name is named bucket #935
- Prevent mix keys in filters (#936) #939
- Fix empty string is not anonymous filter #935
- Filters aggregation: empty name is named bucket #935

### Added
- Support for field_value_factor #953
- Added setMinDocCount and setExtendedBounds options #947
- Avoid environment dependecies in tests #938

### Improvements
- Update elasticsearch dependency to elasticsearch 1.7.3 #957

### Deprecated
- Added exceptions of deprecated transports to deprecation list

## [2.3.0](https://github.com/ruflin/Elastica/releases/tag/2.3.0) - 2015-09-15

Expand Down
2 changes: 1 addition & 1 deletion lib/Elastica/Aggregation/DateHistogram.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ public function setFormat($format)
* @link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-histogram-aggregation.html#search-aggregations-bucket-histogram-aggregation-extended-bounds
*
* @param string $min see link for formatting options
*
* @param string $max see link for formatting options
*
* @return $this
Expand All @@ -149,6 +148,7 @@ public function setExtendedBounds($min = '', $max = '')
$bounds['min'] = $max;
$bounds['max'] = $min;
}

return $this->setParam('extended_bounds', $bounds);
}
}
4 changes: 1 addition & 3 deletions lib/Elastica/Bulk/ResponseSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ public function current()
}
}

/**
* @return void
/**
*/
public function next()
{
Expand All @@ -124,7 +123,6 @@ public function valid()
}

/**
* @return void
*/
public function rewind()
{
Expand Down
3 changes: 3 additions & 0 deletions lib/Elastica/Exception/Bulk/UdpException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

use Elastica\Exception\BulkException;

/**
* @deprecated Will be removed with elasticsearch 2.0
*/
class UdpException extends BulkException
{
}
2 changes: 2 additions & 0 deletions lib/Elastica/Exception/Connection/MemcacheException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* Transport exception.
*
* @author Igor Denisenko <im.denisenko@yahoo.com>
*
* @deprecated Will be removed with elasticsearch 2.0
*/
class MemcacheException extends ConnectionException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Elastica/Exception/Connection/ThriftException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* Transport exception.
*
* @author Mikhail Shamin <munk13@gmail.com>
*
* @deprecated Will be removed with elasticsearch 2.0
*/
class ThriftException extends ConnectionException
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Elastica/Filter/AbstractMulti.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ abstract class AbstractMulti extends AbstractFilter
*/
protected $_filters = array();

/**
/**
* @param array $filters
*/
public function __construct(array $filters = array())
Expand Down
2 changes: 1 addition & 1 deletion lib/Elastica/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public function setFields(array $fields)
}

/**
* Sets the fields not stored to be returned by the search
* Sets the fields not stored to be returned by the search.
*
* @param array $fieldDataFields Fields not stored to be returned
*
Expand Down
16 changes: 8 additions & 8 deletions lib/Elastica/Query/FunctionScore.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ public function addScriptScoreFunction(Script $script, AbstractFilter $filter =
/**
* Add a decay function to the query.
*
* @param string $function see DECAY_* constants for valid options
* @param string $field the document field on which to perform the decay function
* @param string $origin the origin value for this decay function
* @param string $scale a scale to define the rate of decay for this function
* @param string $offset If defined, this function will only be computed for documents with a distance from the origin greater than this value
* @param float $decay optionally defines how documents are scored at the distance given by the $scale parameter
* @param float $weight optional factor by which to multiply the score at the value provided by the $scale parameter
* @param AbstractFilter $filter a filter associated with this function
* @param string $function see DECAY_* constants for valid options
* @param string $field the document field on which to perform the decay function
* @param string $origin the origin value for this decay function
* @param string $scale a scale to define the rate of decay for this function
* @param string $offset If defined, this function will only be computed for documents with a distance from the origin greater than this value
* @param float $decay optionally defines how documents are scored at the distance given by the $scale parameter
* @param float $weight optional factor by which to multiply the score at the value provided by the $scale parameter
* @param AbstractFilter $filter a filter associated with this function
*
* @return $this
*/
Expand Down
1 change: 1 addition & 0 deletions lib/Elastica/Query/Fuzzy.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public function setFieldOption($param, $value)
*
* @param $fieldName
* @param $args
*
* @return $this
*/
public function addField($fieldName, $args)
Expand Down
2 changes: 1 addition & 1 deletion lib/Elastica/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function getData()
{
if (isset($this->_hit['fields']) && !isset($this->_hit['_source'])) {
return $this->getFields();
} else if (isset($this->_hit['fields']) && isset($this->_hit['_source'])) {
} elseif (isset($this->_hit['fields']) && isset($this->_hit['_source'])) {
return array_merge($this->getFields(), $this->getSource());
}

Expand Down
7 changes: 3 additions & 4 deletions lib/Elastica/SearchableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ interface SearchableInterface
* }
* }
*
* @param string|array|\Elastica\Query $query Array with all query data inside or a Elastica\Query object
*
* @param null $options
* @param string|array|\Elastica\Query $query Array with all query data inside or a Elastica\Query object
* @param null $options
*
* @return \Elastica\ResultSet with all results inside
*/
Expand All @@ -46,7 +45,7 @@ public function count($query = '');

/**
* @param \Elastica\Query|string $query
* @param array $options
* @param array $options
*
* @return \Elastica\Search
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/Elastica/Transport/HttpAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class HttpAdapter extends AbstractTransport
/**
* Construct transport.
*
* @param Connection $connection
* @param Connection $connection
* @param HttpAdapterInterface $httpAdapter
*/
public function __construct(Connection $connection = null, HttpAdapterInterface $httpAdapter)
Expand Down
2 changes: 1 addition & 1 deletion lib/Elastica/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ public function deleteById($id, array $options = array())
/**
* Deletes the given list of ids from this type.
*
* @param array $ids
* @param array $ids
* @param string|bool $routing Optional routing key for all ids
*
* @return \Elastica\Response Response object
Expand Down
7 changes: 3 additions & 4 deletions lib/Elastica/Type/AbstractType.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function create($recreate = false)

/**
* @param string|\Elastica\Query $query
* @param array|int $options
* @param array|int $options
*
* @return \Elastica\Search
*/
Expand All @@ -144,9 +144,8 @@ public function createSearch($query = '', $options = null)
/**
* Search on the type.
*
* @param string|array|\Elastica\Query $query Array with all query data inside or a Elastica\Query object
*
* @param null $options
* @param string|array|\Elastica\Query $query Array with all query data inside or a Elastica\Query object
* @param null $options
*
* @return \Elastica\ResultSet with all results inside
*
Expand Down
8 changes: 5 additions & 3 deletions test/lib/Elastica/Test/Base.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace Elastica\Test;

use Elastica\Client;
Expand Down Expand Up @@ -81,12 +82,13 @@ protected function _createIndex($name = null, $delete = true, $shards = 1)
return $index;
}

protected function _checkScriptInlineSetting() {
$scriptInline = $this->_getClient()->getCluster()->getNodes()[0]->getInfo()->get('settings', 'script', 'inline');
protected function _checkScriptInlineSetting()
{
$nodes = $this->_getClient()->getCluster()->getNodes();
$scriptInline = $nodes[0]->getInfo()->get('settings', 'script', 'inline');

if ($scriptInline != 'on') {
$this->markTestSkipped('script.inline is not enabled. This is required for this test');

}
}

Expand Down

0 comments on commit 51eeb9c

Please sign in to comment.