Skip to content

Commit

Permalink
Fix DirectGenerator deprecation errors
Browse files Browse the repository at this point in the history
Deprecation of the below is now enforced in 5.3

- "prefix_len" becomes "prefix_length"
- "min_word_len" becomes "min_word_length"
  • Loading branch information
nicklaw5 committed Apr 5, 2017
1 parent ab9b69b commit 0fc537a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ All notable changes to this project will be documented in this file based on the

- Deprecated `\Elastica\Exception\ElasticsearchException` which is irrelevant since Elasticsearch now exposes the errors as a structured array instead of a single string.
Use `\Elastica\Exception\ResponseException::getResponse::getFullError` instead.
- Deprecated both `prefix_len` & `min_word_len` fields in `Elastica\Suggest\CandidateGenerator\DirectGenerator` as these now return errors when using the phrase suggester to querying terms.
Use `prefix_length` & `min_word_length` instead [#1282](https://github.com/ruflin/Elastica/pull/1282)

## [5.1.0](https://github.com/ruflin/Elastica/compare/5.0.0...5.1.0)

Expand Down
4 changes: 2 additions & 2 deletions lib/Elastica/Suggest/CandidateGenerator/DirectGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function setMaxEdits($max)
*/
public function setPrefixLength($length)
{
return $this->setParam('prefix_len', $length);
return $this->setParam('prefix_length', $length);
}

/**
Expand All @@ -81,7 +81,7 @@ public function setPrefixLength($length)
*/
public function setMinWordLength($min)
{
return $this->setParam('min_word_len', $min);
return $this->setParam('min_word_length', $min);
}

/**
Expand Down

0 comments on commit 0fc537a

Please sign in to comment.