Commit 48712c71 by Carsten Brandt

added notes about default limit set by elasticsearch

fixes #1864
parent 4f7d55c7
......@@ -39,6 +39,9 @@ use yii\db\ActiveQueryTrait;
* $customers = Customer::find()->with('orders')->asArray()->all();
* ~~~
*
* NOTE: elasticsearch limits the number of records returned to 10 records by default.
* If you expect to get more records you should specify limit explicitly.
*
* @author Carsten Brandt <mail@cebe.cc>
* @since 2.0
*/
......
......@@ -22,6 +22,11 @@ use yii\db\ActiveRelationTrait;
*
* If a relation involves a pivot table, it may be specified by [[via()]] method.
*
* NOTE: elasticsearch limits the number of records returned by any query to 10 records by default.
* If you expect to get more records you should specify limit explicitly in relation definition.
* This is also important for relations that use [[via()]] so that if via records are limited to 10
* the relations records can also not be more than 10.
*
* @author Carsten Brandt <mail@cebe.cc>
* @since 2.0
*/
......
......@@ -46,6 +46,9 @@ use yii\db\QueryTrait;
* - [[column()]]: returns the value of the first column in the query result.
* - [[exists()]]: returns a value indicating whether the query result has data or not.
*
* NOTE: elasticsearch limits the number of records returned to 10 records by default.
* If you expect to get more records you should specify limit explicitly.
*
* @author Carsten Brandt <mail@cebe.cc>
* @since 2.0
*/
......
......@@ -48,6 +48,13 @@ Using the Query
TBD
> **NOTE:** elasticsearch limits the number of records returned by any query to 10 records by default.
> If you expect to get more records you should specify limit explicitly in relation definition.
* This is also important for relations that use [[via()]] so that if via records are limited to 10
* the relations records can also not be more than 10.
*
Using the ActiveRecord
----------------------
......@@ -113,6 +120,12 @@ It supports the same interface and features except the following limitations and
on how to compose `query` and `filter` parts.
- It is also possible to define relations from elasticsearch ActiveRecords to normal ActiveRecord classes and vice versa.
> **NOTE:** elasticsearch limits the number of records returned by any query to 10 records by default.
> If you expect to get more records you should specify limit explicitly in query **and also** relation definition.
> This is also important for relations that use via() so that if via records are limited to 10
> the relations records can also not be more than 10.
Usage example:
```php
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment