Skip to content

Commit 86c3598

Browse files
committed
Drop comment about loadModel from README
1 parent 8c04dcc commit 86c3598

1 file changed

Lines changed: 0 additions & 17 deletions

File tree

README.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -119,23 +119,6 @@ $comments = $locator->get('Comments');
119119

120120
> **Note for upgrading users**: The `IndexRegistry` class has been deprecated since version 3.4.3. If you're upgrading from an older version, replace `IndexRegistry::get('Comments')` with the `IndexLocatorAwareTrait` approach shown above or use `IndexLocator` directly.
121121
122-
If you have loaded the plugin with bootstrap enabled you could load indexes using the model factory in your controllers
123-
```php
124-
class SomeController extends AppController
125-
{
126-
public function initialize()
127-
{
128-
$this->loadModel('Comments', 'Elastic');
129-
}
130-
131-
public function index()
132-
{
133-
$comments = $this->Comments->find();
134-
}
135-
136-
...
137-
```
138-
139122
Each `Index` object needs a correspondent Elasticsearch _index_, just like most of `ORM\Table` needs a database _table_.
140123

141124
In the above example, if you have defined a class as `CommentsIndex` and the `IndexLocator` can find it, the `$comments` will receive an initialized object with inner configurations of connection and index. But if you don't have that class, a default one will be initialized and the index name on Elasticsearch mapped to the class.

0 commit comments

Comments
 (0)