diff --git a/src/Aggregation/AbstractAggregation.php b/src/Aggregation/AbstractAggregation.php
index fe59853712605be51d692b95a55a1feb3ad50a07..c2fbe984e13f981a402e83f9a08ef4406c6ffe7e 100644
--- a/src/Aggregation/AbstractAggregation.php
+++ b/src/Aggregation/AbstractAggregation.php
@@ -58,10 +58,14 @@ abstract class AbstractAggregation implements NamedBuilderInterface
 
     /**
      * @param string $field
+     *
+     * @return $this
      */
     public function setField($field)
     {
         $this->field = $field;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Bucketing/ChildrenAggregation.php b/src/Aggregation/Bucketing/ChildrenAggregation.php
index f85e2e801f1dc436e795ab22ebf804fb6e6a5207..f36802aa3b2ca72adaeef219b1ee9bdbd5befdcd 100644
--- a/src/Aggregation/Bucketing/ChildrenAggregation.php
+++ b/src/Aggregation/Bucketing/ChildrenAggregation.php
@@ -50,13 +50,15 @@ class ChildrenAggregation extends AbstractAggregation
     }
 
     /**
-     * Sets children.
-     *
      * @param string $children
+     *
+     * @return $this
      */
     public function setChildren($children)
     {
         $this->children = $children;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Bucketing/CompositeAggregation.php b/src/Aggregation/Bucketing/CompositeAggregation.php
index 5489efc90eff8ca6d157d10bfc1ab963f75a7608..6282b196cd3b539bb3d6745559c6642f66b5fa43 100644
--- a/src/Aggregation/Bucketing/CompositeAggregation.php
+++ b/src/Aggregation/Bucketing/CompositeAggregation.php
@@ -103,11 +103,13 @@ class CompositeAggregation extends AbstractAggregation
      *
      * @param int $size Size
      *
-     * @return void
+     * @return $this
      */
     public function setSize($size)
     {
         $this->size = $size;
+
+        return $this;
     }
 
     /**
@@ -125,11 +127,13 @@ class CompositeAggregation extends AbstractAggregation
      *
      * @param array $after After
      *
-     * @return void
+     * @return $this
      */
     public function setAfter(array $after)
     {
         $this->after = $after;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Bucketing/DateHistogramAggregation.php b/src/Aggregation/Bucketing/DateHistogramAggregation.php
index 4b1009d3d13c33fdd342f8e840837f0d6560ad9c..352b816733243c2cd5bdae78afcd0d1cf145db1e 100644
--- a/src/Aggregation/Bucketing/DateHistogramAggregation.php
+++ b/src/Aggregation/Bucketing/DateHistogramAggregation.php
@@ -59,18 +59,26 @@ class DateHistogramAggregation extends AbstractAggregation
 
     /**
      * @param string $interval
+     *
+     * @return $this
      */
     public function setInterval($interval)
     {
         $this->interval = $interval;
+
+        return $this;
     }
 
     /**
      * @param string $format
+     *
+     * @return $this
      */
     public function setFormat($format)
     {
         $this->format = $format;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Bucketing/DateRangeAggregation.php b/src/Aggregation/Bucketing/DateRangeAggregation.php
index 00184c97ec202bf27ffe8a5b05560ee8c67c4ac9..c522220fb088500c4d964a9f8c9d569a2958c8d7 100644
--- a/src/Aggregation/Bucketing/DateRangeAggregation.php
+++ b/src/Aggregation/Bucketing/DateRangeAggregation.php
@@ -58,10 +58,14 @@ class DateRangeAggregation extends AbstractAggregation
 
     /**
      * @param string $format
+     *
+     * @return $this
      */
     public function setFormat($format)
     {
         $this->format = $format;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Bucketing/DiversifiedSamplerAggregation.php b/src/Aggregation/Bucketing/DiversifiedSamplerAggregation.php
index b6c3461aeb629d6cfa71c324d3caa6dd43d7b778..b16ae9de280027ccdf93373259b7a636830407dc 100644
--- a/src/Aggregation/Bucketing/DiversifiedSamplerAggregation.php
+++ b/src/Aggregation/Bucketing/DiversifiedSamplerAggregation.php
@@ -54,10 +54,14 @@ class DiversifiedSamplerAggregation extends AbstractAggregation
 
     /**
      * @param mixed $shardSize
+     *
+     * @return $this
      */
     public function setShardSize($shardSize)
     {
         $this->shardSize = $shardSize;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Bucketing/FilterAggregation.php b/src/Aggregation/Bucketing/FilterAggregation.php
index cdd179eb57aee4de2c9c05662dac95e84f1dae2a..c7d1fa9d035696390d396d940651469760fbb4e0 100644
--- a/src/Aggregation/Bucketing/FilterAggregation.php
+++ b/src/Aggregation/Bucketing/FilterAggregation.php
@@ -45,13 +45,15 @@ class FilterAggregation extends AbstractAggregation
     }
 
     /**
-     * Sets a filter.
-     *
      * @param BuilderInterface $filter
+     *
+     * @return $this
      */
     public function setFilter(BuilderInterface $filter)
     {
         $this->filter = $filter;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Bucketing/FiltersAggregation.php b/src/Aggregation/Bucketing/FiltersAggregation.php
index bcff22ffb20dad0f5de0b1ec521213a74f05c253..9bd52c6aafb13f1badd108057903821107505ee1 100644
--- a/src/Aggregation/Bucketing/FiltersAggregation.php
+++ b/src/Aggregation/Bucketing/FiltersAggregation.php
@@ -58,7 +58,7 @@ class FiltersAggregation extends AbstractAggregation
     /**
      * @param bool $anonymous
      *
-     * @return FiltersAggregation
+     * @return $this
      */
     public function setAnonymous($anonymous)
     {
diff --git a/src/Aggregation/Bucketing/GeoDistanceAggregation.php b/src/Aggregation/Bucketing/GeoDistanceAggregation.php
index 6772ea5e67cf55361aa0fc1219d31125a9de3842..81db370da50a9492aa5805abd18b3b5d0038cbea 100644
--- a/src/Aggregation/Bucketing/GeoDistanceAggregation.php
+++ b/src/Aggregation/Bucketing/GeoDistanceAggregation.php
@@ -78,10 +78,14 @@ class GeoDistanceAggregation extends AbstractAggregation
 
     /**
      * @param mixed $origin
+     *
+     * @return $this
      */
     public function setOrigin($origin)
     {
         $this->origin = $origin;
+
+        return $this;
     }
 
     /**
@@ -94,10 +98,14 @@ class GeoDistanceAggregation extends AbstractAggregation
 
     /**
      * @param string $distanceType
+     *
+     * @return $this
      */
     public function setDistanceType($distanceType)
     {
         $this->distanceType = $distanceType;
+
+        return $this;
     }
 
     /**
@@ -110,10 +118,14 @@ class GeoDistanceAggregation extends AbstractAggregation
 
     /**
      * @param string $unit
+     *
+     * @return $this
      */
     public function setUnit($unit)
     {
         $this->unit = $unit;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Bucketing/GeoHashGridAggregation.php b/src/Aggregation/Bucketing/GeoHashGridAggregation.php
index cf7fff9328149f768af4e3d40cbe002956477f01..613026a7585da013bc4612666cf296b51f2e35dd 100644
--- a/src/Aggregation/Bucketing/GeoHashGridAggregation.php
+++ b/src/Aggregation/Bucketing/GeoHashGridAggregation.php
@@ -67,10 +67,14 @@ class GeoHashGridAggregation extends AbstractAggregation
 
     /**
      * @param int $precision
+     *
+     * @return $this
      */
     public function setPrecision($precision)
     {
         $this->precision = $precision;
+
+        return $this;
     }
 
     /**
@@ -83,10 +87,14 @@ class GeoHashGridAggregation extends AbstractAggregation
 
     /**
      * @param int $size
+     *
+     * @return $this
      */
     public function setSize($size)
     {
         $this->size = $size;
+
+        return $this;
     }
 
     /**
@@ -99,10 +107,14 @@ class GeoHashGridAggregation extends AbstractAggregation
 
     /**
      * @param int $shardSize
+     *
+     * @return $this
      */
     public function setShardSize($shardSize)
     {
         $this->shardSize = $shardSize;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Bucketing/HistogramAggregation.php b/src/Aggregation/Bucketing/HistogramAggregation.php
index 3a7cf9723204754f321384aae796da4c060a84d4..f23875855a6dc9054fbf5d2fb7cd0569feb545ab 100644
--- a/src/Aggregation/Bucketing/HistogramAggregation.php
+++ b/src/Aggregation/Bucketing/HistogramAggregation.php
@@ -102,10 +102,14 @@ class HistogramAggregation extends AbstractAggregation
      * Get response as a hash instead keyed by the buckets keys.
      *
      * @param bool $keyed
+     *
+     * @return $this
      */
     public function setKeyed($keyed)
     {
         $this->keyed = $keyed;
+
+        return $this;
     }
 
     /**
@@ -113,11 +117,15 @@ class HistogramAggregation extends AbstractAggregation
      *
      * @param string $mode
      * @param string $direction
+     *
+     * @return $this
      */
     public function setOrder($mode, $direction = self::DIRECTION_ASC)
     {
         $this->orderMode = $mode;
         $this->orderDirection = $direction;
+
+        return $this;
     }
 
     /**
@@ -142,10 +150,14 @@ class HistogramAggregation extends AbstractAggregation
 
     /**
      * @param int $interval
+     *
+     * @return $this
      */
     public function setInterval($interval)
     {
         $this->interval = $interval;
+
+        return $this;
     }
 
     /**
@@ -160,10 +172,14 @@ class HistogramAggregation extends AbstractAggregation
      * Set limit for document count buckets should have.
      *
      * @param int $minDocCount
+     *
+     * @return $this
      */
     public function setMinDocCount($minDocCount)
     {
         $this->minDocCount = $minDocCount;
+
+        return $this;
     }
 
     /**
@@ -177,6 +193,8 @@ class HistogramAggregation extends AbstractAggregation
     /**
      * @param int $min
      * @param int $max
+     *
+     * @return $this
      */
     public function setExtendedBounds($min = null, $max = null)
     {
@@ -188,6 +206,8 @@ class HistogramAggregation extends AbstractAggregation
             'strlen'
         );
         $this->extendedBounds = $bounds;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Bucketing/NestedAggregation.php b/src/Aggregation/Bucketing/NestedAggregation.php
index 237318b6550eb17e3d5cb23bdf3d628c17c1ad0c..39e3d9e2de5387c2e41a3d3a69f41924c83bb3d4 100644
--- a/src/Aggregation/Bucketing/NestedAggregation.php
+++ b/src/Aggregation/Bucketing/NestedAggregation.php
@@ -52,13 +52,15 @@ class NestedAggregation extends AbstractAggregation
     }
 
     /**
-     * Sets path.
-     *
      * @param string $path
+     *
+     * @return $this
      */
     public function setPath($path)
     {
         $this->path = $path;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Bucketing/RangeAggregation.php b/src/Aggregation/Bucketing/RangeAggregation.php
index 7dede29953b01471b8dab61ae1f01f6fb0e4dfb0..e86faedfc17ebf44e8afe63f43713b87eeafbf05 100644
--- a/src/Aggregation/Bucketing/RangeAggregation.php
+++ b/src/Aggregation/Bucketing/RangeAggregation.php
@@ -60,7 +60,7 @@ class RangeAggregation extends AbstractAggregation
      *
      * @param bool $keyed
      *
-     * @return RangeAggregation
+     * @return $this
      */
     public function setKeyed($keyed)
     {
diff --git a/src/Aggregation/Bucketing/ReverseNestedAggregation.php b/src/Aggregation/Bucketing/ReverseNestedAggregation.php
index c46c7b1e7516b41f4cc1ce5f02c2935cdc689333..6cda4b8c1b64bc136d0cf965ab8ca5a3068ce170 100644
--- a/src/Aggregation/Bucketing/ReverseNestedAggregation.php
+++ b/src/Aggregation/Bucketing/ReverseNestedAggregation.php
@@ -52,13 +52,15 @@ class ReverseNestedAggregation extends AbstractAggregation
     }
 
     /**
-     * Sets path.
-     *
      * @param string $path
+     *
+     * @return $this
      */
     public function setPath($path)
     {
         $this->path = $path;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Bucketing/SamplerAggregation.php b/src/Aggregation/Bucketing/SamplerAggregation.php
index 1a09079557250ee73b5878858ae7027eabc26c00..aa90b46097edb849f3a775ae450b281e741a536c 100644
--- a/src/Aggregation/Bucketing/SamplerAggregation.php
+++ b/src/Aggregation/Bucketing/SamplerAggregation.php
@@ -54,10 +54,14 @@ class SamplerAggregation extends AbstractAggregation
 
     /**
      * @param int $shardSize
+     *
+     * @return $this
      */
     public function setShardSize($shardSize)
     {
         $this->shardSize = $shardSize;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Matrix/MatrixStatsAggregation.php b/src/Aggregation/Matrix/MatrixStatsAggregation.php
index 5fb916d855a78952f4332f49899a9a7492241971..619aae90b083c48688677a9ad86f12e113d2eafb 100644
--- a/src/Aggregation/Matrix/MatrixStatsAggregation.php
+++ b/src/Aggregation/Matrix/MatrixStatsAggregation.php
@@ -60,10 +60,14 @@ class MaxAggregation extends AbstractAggregation
 
     /**
      * @param string $mode
+     *
+     * @return $this
      */
     public function setMode($mode)
     {
         $this->mode = $mode;
+
+        return $this;
     }
 
     /**
@@ -76,10 +80,14 @@ class MaxAggregation extends AbstractAggregation
 
     /**
      * @param array $missing
+     *
+     * @return $this
      */
     public function setMissing($missing)
     {
         $this->missing = $missing;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Metric/CardinalityAggregation.php b/src/Aggregation/Metric/CardinalityAggregation.php
index 10547875b39e5fdc9605ae9333c5fbb47cabfb3b..bcaaaf659c628ed887de881a00f6800146315038 100644
--- a/src/Aggregation/Metric/CardinalityAggregation.php
+++ b/src/Aggregation/Metric/CardinalityAggregation.php
@@ -58,13 +58,15 @@ class CardinalityAggregation extends AbstractAggregation
     }
 
     /**
-     * Precision threshold.
+     * @param int $precision
      *
-     * @param int $precision Precision Threshold.
+     * @return $this
      */
     public function setPrecisionThreshold($precision)
     {
         $this->precisionThreshold = $precision;
+
+        return $this;
     }
 
     /**
@@ -85,10 +87,14 @@ class CardinalityAggregation extends AbstractAggregation
 
     /**
      * @param bool $rehash
+     *
+     * @return $this
      */
     public function setRehash($rehash)
     {
         $this->rehash = $rehash;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Metric/ExtendedStatsAggregation.php b/src/Aggregation/Metric/ExtendedStatsAggregation.php
index 4c5dac2c2c9eaa89eb0660b2c105b29e1e2d6571..660dc0d00821b1a49019aa3b1c2e6efcb1b2da8f 100644
--- a/src/Aggregation/Metric/ExtendedStatsAggregation.php
+++ b/src/Aggregation/Metric/ExtendedStatsAggregation.php
@@ -57,10 +57,14 @@ class ExtendedStatsAggregation extends AbstractAggregation
 
     /**
      * @param int $sigma
+     *
+     * @return $this
      */
     public function setSigma($sigma)
     {
         $this->sigma = $sigma;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Metric/GeoBoundsAggregation.php b/src/Aggregation/Metric/GeoBoundsAggregation.php
index 734f5680b632b08a3b2964368678184009432487..3f01a1dd541b1c5eeecce7e80291e9207da7c688 100644
--- a/src/Aggregation/Metric/GeoBoundsAggregation.php
+++ b/src/Aggregation/Metric/GeoBoundsAggregation.php
@@ -53,10 +53,14 @@ class GeoBoundsAggregation extends AbstractAggregation
 
     /**
      * @param bool $wrapLongitude
+     *
+     * @return $this
      */
     public function setWrapLongitude($wrapLongitude)
     {
         $this->wrapLongitude = $wrapLongitude;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Metric/PercentileRanksAggregation.php b/src/Aggregation/Metric/PercentileRanksAggregation.php
index d335d99310ca53db84cb31282c90620274f6ac6b..d0fb2c0a82904429c3495e4396d55cdb7ff53c57 100644
--- a/src/Aggregation/Metric/PercentileRanksAggregation.php
+++ b/src/Aggregation/Metric/PercentileRanksAggregation.php
@@ -64,10 +64,14 @@ class PercentileRanksAggregation extends AbstractAggregation
 
     /**
      * @param array $values
+     *
+     * @return $this
      */
     public function setValues($values)
     {
         $this->values = $values;
+
+        return $this;
     }
 
     /**
@@ -80,10 +84,14 @@ class PercentileRanksAggregation extends AbstractAggregation
 
     /**
      * @param int $compression
+     *
+     * @return $this
      */
     public function setCompression($compression)
     {
         $this->compression = $compression;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Metric/PercentilesAggregation.php b/src/Aggregation/Metric/PercentilesAggregation.php
index bb7c723c5c1d22d9ba5eedda90ea9302c6ad263a..627bb56824fa6425413d4902c97a96a23bde0de9 100644
--- a/src/Aggregation/Metric/PercentilesAggregation.php
+++ b/src/Aggregation/Metric/PercentilesAggregation.php
@@ -64,10 +64,14 @@ class PercentilesAggregation extends AbstractAggregation
 
     /**
      * @param array $percents
+     *
+     * @return $this
      */
     public function setPercents($percents)
     {
         $this->percents = $percents;
+
+        return $this;
     }
 
     /**
@@ -80,10 +84,14 @@ class PercentilesAggregation extends AbstractAggregation
 
     /**
      * @param int $compression
+     *
+     * @return $this
      */
     public function setCompression($compression)
     {
         $this->compression = $compression;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Metric/ScriptedMetricAggregation.php b/src/Aggregation/Metric/ScriptedMetricAggregation.php
index bf74fe819f2a017f1aa49000c55854836b2e0241..a88412f76baa3246242298ada4a991f397107f29 100644
--- a/src/Aggregation/Metric/ScriptedMetricAggregation.php
+++ b/src/Aggregation/Metric/ScriptedMetricAggregation.php
@@ -85,10 +85,14 @@ class ScriptedMetricAggregation extends AbstractAggregation
 
     /**
      * @param mixed $initScript
+     *
+     * @return $this
      */
     public function setInitScript($initScript)
     {
         $this->initScript = $initScript;
+
+        return $this;
     }
 
     /**
@@ -101,10 +105,14 @@ class ScriptedMetricAggregation extends AbstractAggregation
 
     /**
      * @param mixed $mapScript
+     *
+     * @return $this
      */
     public function setMapScript($mapScript)
     {
         $this->mapScript = $mapScript;
+
+        return $this;
     }
 
     /**
@@ -117,10 +125,14 @@ class ScriptedMetricAggregation extends AbstractAggregation
 
     /**
      * @param mixed $combineScript
+     *
+     * @return $this
      */
     public function setCombineScript($combineScript)
     {
         $this->combineScript = $combineScript;
+
+        return $this;
     }
 
     /**
@@ -133,10 +145,14 @@ class ScriptedMetricAggregation extends AbstractAggregation
 
     /**
      * @param mixed $reduceScript
+     *
+     * @return $this
      */
     public function setReduceScript($reduceScript)
     {
         $this->reduceScript = $reduceScript;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Metric/TopHitsAggregation.php b/src/Aggregation/Metric/TopHitsAggregation.php
index af10e0c1af57db56c3cbfdaa35e07c7a42bbb070..01225666e795624bd785f1a969bac46a0dcf0751 100644
--- a/src/Aggregation/Metric/TopHitsAggregation.php
+++ b/src/Aggregation/Metric/TopHitsAggregation.php
@@ -66,13 +66,15 @@ class TopHitsAggregation extends AbstractAggregation
     }
 
     /**
-     * Set from.
-     *
      * @param int $from
+     *
+     * @return $this
      */
     public function setFrom($from)
     {
         $this->from = $from;
+
+        return $this;
     }
 
     /**
@@ -85,10 +87,14 @@ class TopHitsAggregation extends AbstractAggregation
 
     /**
      * @param BuilderInterface[] $sorts
+     *
+     * @return $this
      */
     public function setSorts(array $sorts)
     {
         $this->sorts = $sorts;
+
+        return $this;
     }
 
     /**
@@ -102,13 +108,15 @@ class TopHitsAggregation extends AbstractAggregation
     }
 
     /**
-     * Set size.
-     *
      * @param int $size
+     *
+     * @return $this
      */
     public function setSize($size)
     {
         $this->size = $size;
+
+        return $this;
     }
 
     /**
@@ -176,12 +184,14 @@ class TopHitsAggregation extends AbstractAggregation
     /**
      * @deprecated sorts now is a container, use `addSort()`instead.
      *
-     * Set sort.
-     *
      * @param BuilderInterface $sort
+     *
+     * @return $this
      */
     public function setSort(BuilderInterface $sort)
     {
         $this->sort = $sort;
+
+        return $this;
     }
 }
diff --git a/src/Aggregation/Pipeline/AbstractPipelineAggregation.php b/src/Aggregation/Pipeline/AbstractPipelineAggregation.php
index dac89fc4e15ed2dbb6b4a0073cfb27db9c8dbbe0..4259c057bda4d30191efef5f7aa8f7587649830a 100644
--- a/src/Aggregation/Pipeline/AbstractPipelineAggregation.php
+++ b/src/Aggregation/Pipeline/AbstractPipelineAggregation.php
@@ -34,10 +34,14 @@ abstract class AbstractPipelineAggregation extends AbstractAggregation
 
     /**
      * @param string $bucketsPath
+     *
+     * @return $this
      */
     public function setBucketsPath($bucketsPath)
     {
         $this->bucketsPath = $bucketsPath;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Pipeline/BucketScriptAggregation.php b/src/Aggregation/Pipeline/BucketScriptAggregation.php
index ac1d90ac343119dbf9cd040883963c95082a6d6f..f0f4c615a6482189ce6e7737a9f64086be896a28 100644
--- a/src/Aggregation/Pipeline/BucketScriptAggregation.php
+++ b/src/Aggregation/Pipeline/BucketScriptAggregation.php
@@ -44,10 +44,14 @@ class BucketScriptAggregation extends AbstractPipelineAggregation
 
     /**
      * @param string $script
+     *
+     * @return $this
      */
     public function setScript($script)
     {
         $this->script = $script;
+
+        return $this;
     }
 
     /**
diff --git a/src/Aggregation/Pipeline/BucketSortAggregation.php b/src/Aggregation/Pipeline/BucketSortAggregation.php
index 3b04ee3d87c3ca2ce1dd403c1eb88dc03ebb38af..06dd5dc51b9f23e308956d7916d32a03f3c6d8e9 100644
--- a/src/Aggregation/Pipeline/BucketSortAggregation.php
+++ b/src/Aggregation/Pipeline/BucketSortAggregation.php
@@ -53,11 +53,13 @@ class BucketSortAggregation extends AbstractPipelineAggregation
 
     /**
      * @param string $sort
-     * @return self
+     *
+     * @return $this
      */
     public function setSort($sort)
     {
         $this->sort = $sort;
+
         return $this;
     }
 
diff --git a/src/Aggregation/Pipeline/PercentilesBucketAggregation.php b/src/Aggregation/Pipeline/PercentilesBucketAggregation.php
index d74b88f1ca7ee5259a0751c7925c77868e102a2e..6c0c9a3c46749801d971dc7960b808bea92636cc 100644
--- a/src/Aggregation/Pipeline/PercentilesBucketAggregation.php
+++ b/src/Aggregation/Pipeline/PercentilesBucketAggregation.php
@@ -41,10 +41,14 @@ class PercentilesBucketAggregation extends AbstractPipelineAggregation
 
     /**
      * @param array $percents
+     *
+     * @return $this
      */
     public function setPercents(array $percents)
     {
         $this->percents = $percents;
+
+        return $this;
     }
 
     /**
diff --git a/src/FieldAwareTrait.php b/src/FieldAwareTrait.php
index 3316e51c66b2a447e332388c2bef1c9b5244ef8e..5cfaabc6789abca9bc08fcf5ca85819c0ab0466b 100644
--- a/src/FieldAwareTrait.php
+++ b/src/FieldAwareTrait.php
@@ -27,10 +27,14 @@ trait FieldAwareTrait
     }
 
     /**
-     * @param mixed $field
+     * @param string $field
+     *
+     * @return $this
      */
     public function setField($field)
     {
         $this->field = $field;
+
+        return $this;
     }
 }
diff --git a/src/NameAwareTrait.php b/src/NameAwareTrait.php
index c76c9375eb24c4e9be795758603877b4135d7f01..ccd620e2b050d0f3b7d83a600b6f8637cc9a94e8 100644
--- a/src/NameAwareTrait.php
+++ b/src/NameAwareTrait.php
@@ -27,10 +27,14 @@ trait NameAwareTrait
     }
 
     /**
-     * @param mixed $name
+     * @param string $name
+     *
+     * @return $this
      */
     public function setName($name)
     {
         $this->name = $name;
+
+        return $this;
     }
 }
diff --git a/src/ParametersTrait.php b/src/ParametersTrait.php
index 5cd2fd69b2620101dc67b065549ad21a4f88162c..5305f77637a9c827e997c83934656881cd83758c 100644
--- a/src/ParametersTrait.php
+++ b/src/ParametersTrait.php
@@ -77,13 +77,15 @@ trait ParametersTrait
     }
 
     /**
-     * Sets an array of parameters.
-     *
      * @param array $parameters
+     *
+     * @return $this
      */
     public function setParameters(array $parameters)
     {
         $this->parameters = $parameters;
+
+        return $this;
     }
 
     /**
diff --git a/src/Query/Span/FieldMaskingSpanQuery.php b/src/Query/Span/FieldMaskingSpanQuery.php
index 9738c20193036b50e8f4f503533c9c4825b05457..f2cc45783f6949308782cf8693a2fe1e7a35b9eb 100644
--- a/src/Query/Span/FieldMaskingSpanQuery.php
+++ b/src/Query/Span/FieldMaskingSpanQuery.php
@@ -52,11 +52,13 @@ class FieldMaskingSpanQuery implements SpanQueryInterface
 
     /**
      * @param mixed $query
-     * @return self
+     *
+     * @return $this
      */
     public function setQuery($query)
     {
         $this->query = $query;
+
         return $this;
     }
 
@@ -70,11 +72,13 @@ class FieldMaskingSpanQuery implements SpanQueryInterface
 
     /**
      * @param string $field
-     * @return FieldMaskingSpanQuery
+     *
+     * @return $this
      */
     public function setField($field)
     {
         $this->field = $field;
+
         return $this;
     }
 
diff --git a/src/Query/Span/SpanContainingQuery.php b/src/Query/Span/SpanContainingQuery.php
index eaf149657eade62e363a521f1fd9388a5bfbfeef..aed6e67b04db791d5ac18a761ef3afb63d690168 100644
--- a/src/Query/Span/SpanContainingQuery.php
+++ b/src/Query/Span/SpanContainingQuery.php
@@ -52,10 +52,14 @@ class SpanContainingQuery implements SpanQueryInterface
 
     /**
      * @param SpanQueryInterface $little
+     *
+     * @return $this
      */
     public function setLittle(SpanQueryInterface $little)
     {
         $this->little = $little;
+
+        return $this;
     }
 
     /**
@@ -68,10 +72,14 @@ class SpanContainingQuery implements SpanQueryInterface
 
     /**
      * @param SpanQueryInterface $big
+     *
+     * @return $this
      */
     public function setBig(SpanQueryInterface $big)
     {
         $this->big = $big;
+
+        return $this;
     }
 
     /**
diff --git a/src/Query/Span/SpanNearQuery.php b/src/Query/Span/SpanNearQuery.php
index 56436038fcb2a0bf3031a927198168b76421abe4..086f414b00e16fc7628b44154c981780f765e8b1 100644
--- a/src/Query/Span/SpanNearQuery.php
+++ b/src/Query/Span/SpanNearQuery.php
@@ -33,10 +33,14 @@ class SpanNearQuery extends SpanOrQuery implements SpanQueryInterface
 
     /**
      * @param int $slop
+     *
+     * @return $this
      */
     public function setSlop($slop)
     {
         $this->slop = $slop;
+
+        return $this;
     }
 
     /**
diff --git a/src/Query/Specialized/TemplateQuery.php b/src/Query/Specialized/TemplateQuery.php
index b8b122df8bcadfea289c825a3e5c983dee6e425e..ab541d37c917128e71b1c897ae45ee669d9d3368 100644
--- a/src/Query/Specialized/TemplateQuery.php
+++ b/src/Query/Specialized/TemplateQuery.php
@@ -60,10 +60,14 @@ class TemplateQuery implements BuilderInterface
 
     /**
      * @param string $file
+     *
+     * @return $this;
      */
     public function setFile($file)
     {
         $this->file = $file;
+
+        return $this;
     }
 
     /**
@@ -76,10 +80,14 @@ class TemplateQuery implements BuilderInterface
 
     /**
      * @param string $inline
+     *
+     * @return $this
      */
     public function setInline($inline)
     {
         $this->inline = $inline;
+
+        return $this;
     }
 
     /**
@@ -92,10 +100,14 @@ class TemplateQuery implements BuilderInterface
 
     /**
      * @param array $params
+     *
+     * @return $this
      */
     public function setParams($params)
     {
         $this->params = $params;
+
+        return $this;
     }
 
     /**
diff --git a/src/ScriptAwareTrait.php b/src/ScriptAwareTrait.php
index 72489ae6077a6d22f88b61d79d8fba0fa231a151..6eb2148efd750ae7338cdb9929cc2361584e66cb 100644
--- a/src/ScriptAwareTrait.php
+++ b/src/ScriptAwareTrait.php
@@ -31,9 +31,13 @@ trait ScriptAwareTrait
 
     /**
      * @param string $script
+     *
+     * @return $this
      */
     public function setScript($script)
     {
         $this->script = $script;
+
+        return $this;
     }
 }
diff --git a/src/Search.php b/src/Search.php
index db5b1fff8bd3bf02f5f82aebc1244e47d084987e..fbbd9fc4cec3a433e533919411af91fee8c37079 100644
--- a/src/Search.php
+++ b/src/Search.php
@@ -259,12 +259,16 @@ class Search
      *
      * @param string $endpointName
      * @param array  $parameters
+     *
+     * @return $this
      */
     public function setEndpointParameters($endpointName, array $parameters)
     {
         /** @var AbstractSearchEndpoint $endpoint */
         $endpoint = $this->getEndpoint($endpointName);
         $endpoint->setParameters($parameters);
+
+        return $this;
     }
 
     /**
@@ -447,11 +451,13 @@ class Search
 
     /**
      * @param int $from
+     *
      * @return $this
      */
     public function setFrom($from)
     {
         $this->from = $from;
+
         return $this;
     }
 
@@ -465,11 +471,13 @@ class Search
 
     /**
      * @param bool $trackTotalHits
+     *
      * @return $this
      */
     public function setTrackTotalHits(bool $trackTotalHits)
     {
         $this->trackTotalHits = $trackTotalHits;
+
         return $this;
     }
 
@@ -483,11 +491,13 @@ class Search
 
     /**
      * @param int $size
+     *
      * @return $this
      */
     public function setSize($size)
     {
         $this->size = $size;
+
         return $this;
     }
 
@@ -501,11 +511,13 @@ class Search
 
     /**
      * @param bool $source
+     *
      * @return $this
      */
     public function setSource($source)
     {
         $this->source = $source;
+
         return $this;
     }
 
@@ -519,11 +531,13 @@ class Search
 
     /**
      * @param array $storedFields
+     *
      * @return $this
      */
     public function setStoredFields($storedFields)
     {
         $this->storedFields = $storedFields;
+
         return $this;
     }
 
@@ -537,11 +551,13 @@ class Search
 
     /**
      * @param array $scriptFields
+     *
      * @return $this
      */
     public function setScriptFields($scriptFields)
     {
         $this->scriptFields = $scriptFields;
+
         return $this;
     }
 
@@ -555,11 +571,13 @@ class Search
 
     /**
      * @param array $docValueFields
+     *
      * @return $this
      */
     public function setDocValueFields($docValueFields)
     {
         $this->docValueFields = $docValueFields;
+
         return $this;
     }
 
@@ -573,11 +591,13 @@ class Search
 
     /**
      * @param bool $explain
+     *
      * @return $this
      */
     public function setExplain($explain)
     {
         $this->explain = $explain;
+
         return $this;
     }
 
@@ -591,11 +611,13 @@ class Search
 
     /**
      * @param bool $version
+     *
      * @return $this
      */
     public function setVersion($version)
     {
         $this->version = $version;
+
         return $this;
     }
 
@@ -609,11 +631,13 @@ class Search
 
     /**
      * @param array $indicesBoost
+     *
      * @return $this
      */
     public function setIndicesBoost($indicesBoost)
     {
         $this->indicesBoost = $indicesBoost;
+
         return $this;
     }
 
@@ -627,11 +651,13 @@ class Search
 
     /**
      * @param int $minScore
+     *
      * @return $this
      */
     public function setMinScore($minScore)
     {
         $this->minScore = $minScore;
+
         return $this;
     }
 
@@ -645,11 +671,13 @@ class Search
 
     /**
      * @param array $searchAfter
+     *
      * @return $this
      */
     public function setSearchAfter($searchAfter)
     {
         $this->searchAfter = $searchAfter;
+
         return $this;
     }
 
@@ -663,6 +691,7 @@ class Search
 
     /**
      * @param string $scroll
+     *
      * @return $this
      */
     public function setScroll($scroll = '5m')
diff --git a/src/Sort/FieldSort.php b/src/Sort/FieldSort.php
index 2db958300e80f431308c305569b3668a7a49fc72..36cb8908d1be6c57033bf648e8309d107fd1b511 100644
--- a/src/Sort/FieldSort.php
+++ b/src/Sort/FieldSort.php
@@ -61,11 +61,13 @@ class FieldSort implements BuilderInterface
 
     /**
      * @param string $field
-     * @return self
+     *
+     * @return $this
      */
     public function setField($field)
     {
         $this->field = $field;
+
         return $this;
     }
 
@@ -79,11 +81,13 @@ class FieldSort implements BuilderInterface
 
     /**
      * @param string $order
-     * @return self
+     *
+     * @return $this
      */
     public function setOrder($order)
     {
         $this->order = $order;
+
         return $this;
     }
 
@@ -97,10 +101,14 @@ class FieldSort implements BuilderInterface
 
     /**
      * @param BuilderInterface $nestedFilter
+     *
+     * @return $this
      */
     public function setNestedFilter(BuilderInterface $nestedFilter)
     {
         $this->nestedFilter = $nestedFilter;
+
+        return $this;
     }
 
     /**
diff --git a/src/Sort/NestedSort.php b/src/Sort/NestedSort.php
index 807546bd2569b987639aa5f2a3d309c83275b21b..8954719fc2cebe8405c9008f03c3c2a59cc8b2ed 100644
--- a/src/Sort/NestedSort.php
+++ b/src/Sort/NestedSort.php
@@ -111,9 +111,13 @@ class NestedSort implements BuilderInterface
 
     /**
      * @param BuilderInterface $nestedFilter
+     *
+     * @return $this
      */
     public function setNestedFilter(BuilderInterface $nestedFilter)
     {
         $this->nestedFilter = $nestedFilter;
+
+        return $this;
     }
 }
diff --git a/src/Suggest/Suggest.php b/src/Suggest/Suggest.php
index 5baab7038454f3f0283ad720c454cc41a96defd8..1738d84da83ff8c52e7bf2cbd3947bc1d9efe7f2 100644
--- a/src/Suggest/Suggest.php
+++ b/src/Suggest/Suggest.php
@@ -58,10 +58,14 @@ class Suggest implements NamedBuilderInterface
 
     /**
      * @param string $name
+     *
+     * @return $this
      */
     public function setName($name)
     {
         $this->name = $name;
+
+        return $this;
     }
 
     /**
@@ -86,10 +90,14 @@ class Suggest implements NamedBuilderInterface
 
     /**
      * @param string $type
+     *
+     * @return $this
      */
     public function setType($type)
     {
         $this->type = $type;
+
+        return $this;
     }
 
     /**
@@ -102,10 +110,14 @@ class Suggest implements NamedBuilderInterface
 
     /**
      * @param string $text
+     *
+     * @return $this
      */
     public function setText($text)
     {
         $this->text = $text;
+
+        return $this;
     }
 
     /**
@@ -118,10 +130,14 @@ class Suggest implements NamedBuilderInterface
 
     /**
      * @param string $field
+     *
+     * @return $this
      */
     public function setField($field)
     {
         $this->field = $field;
+
+        return $this;
     }
 
     /**