Elastica

A PHP client for elasticsearch.

Fork me on GitHub

Release v0.20.5.0

Migration Guide From 0.19 to 0.20

First you had to meet the conditions and install Elastica 0.20 version which work with elasticsearch 0.20.

Elastica 0.20 uses namespace that’s why PHP5.3 is required , and each class belongs of a namespace.

For understanding namespace , and how use it let see php.net

Each class which call with an underscore , is include in a namespace.

Example :

1
2
3
4
5
6
7
8
9
//Before
$Document=new Elastica_Document($id,$documentArray);
//Now
$Document=new \Elastica\Document($id,$documentArray);

//Before
$BoolOr=new Elastica_Filter_BoolOr();
//Now
$BoolOr=new Elastica\Filter\BoolOr();

Migration on class

List of Deleted class

  • Elastica_Filter_Or
  • Elastica_Filter_And

List of Deprecated class

Ex method New method Comments
Elastica_Filter_Or Elastica\Filter\BoolOr
Elastica_Filter_And Elastica\Filter\BoolAnd

List of new class

  • Elastica\Connection()

Migration on methods

List of Deleted methods

  • \Elastica\Type::getType()
  • \Elastica\Filter\Script::setQuery()
  • \Elastica\Query\QueryString::setQueryString()
  • \Elastica\Query\Builder::minimumShouldMatch()
  • \Elastica\Query\Builder::tieBreaker()

List of Deprecated methods

Ex method New method Comments
Elastica_Document::add($key,$value) Elastica\Document::set($key,$value)

List of new methods

  • \Elastica\Facet\Terms::setScript()
  • \Elastica\Document::set() && get() && has() && remove()