summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/lib/Elastica/Suggest/AbstractSuggest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Suggest/AbstractSuggest.php')
-rw-r--r--vendor/ruflin/elastica/lib/Elastica/Suggest/AbstractSuggest.php33
1 files changed, 19 insertions, 14 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Suggest/AbstractSuggest.php b/vendor/ruflin/elastica/lib/Elastica/Suggest/AbstractSuggest.php
index e5f5e01c..00f21e44 100644
--- a/vendor/ruflin/elastica/lib/Elastica/Suggest/AbstractSuggest.php
+++ b/vendor/ruflin/elastica/lib/Elastica/Suggest/AbstractSuggest.php
@@ -1,13 +1,10 @@
<?php
-
namespace Elastica\Suggest;
-
use Elastica\Param;
/**
- * Class AbstractSuggestion
- * @package Elastica\Suggest
+ * Class AbstractSuggestion.
*/
abstract class AbstractSuggest extends Param
{
@@ -32,45 +29,52 @@ abstract class AbstractSuggest extends Param
}
/**
- * Suggest text must be set either globally or per suggestion
+ * Suggest text must be set either globally or per suggestion.
+ *
* @param string $text
- * @return \Elastica\Suggest\AbstractSuggest
+ *
+ * @return $this
*/
public function setText($text)
{
$this->_text = $text;
+
return $this;
}
/**
* @param string $field
- * @return \Elastica\Suggest\AbstractSuggest
+ *
+ * @return $this
*/
public function setField($field)
{
- return $this->setParam("field", $field);
+ return $this->setParam('field', $field);
}
/**
* @param int $size
- * @return \Elastica\Suggest\AbstractSuggest
+ *
+ * @return $this
*/
public function setSize($size)
{
- return $this->setParam("size", $size);
+ return $this->setParam('size', $size);
}
/**
* @param int $size maximum number of suggestions to be retrieved from each shard
- * @return \Elastica\Suggest\AbstractSuggest
+ *
+ * @return $this
*/
public function setShardSize($size)
{
- return $this->setParam("shard_size", $size);
+ return $this->setParam('shard_size', $size);
}
/**
- * Retrieve the name of this suggestion
+ * Retrieve the name of this suggestion.
+ *
* @return string
*/
public function getName()
@@ -87,6 +91,7 @@ abstract class AbstractSuggest extends Param
if (isset($this->_text)) {
$array['text'] = $this->_text;
}
+
return $array;
}
-} \ No newline at end of file
+}