-
-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update Query.php (#131) * PHPUnit compatibility, provide token for github auth * token update * yet another update * Fix #134 infinite query loop when the index does not exist * improved error message for cluster auto detection issue #137 * updated docs about cluster autodetection fixes #137 * Elasticsearch logo added to README.md * Composer json change * Added alias actions to Command * Fix for desirialization of plain response from elasticsearch * Bring back old name for package * Fix for php 5.4 * Added phpdocs, fixes and tests * CHANGELOG.md * clarify version compatibility * Fixing broken elasticsearch doc links (#144) [skip ci] * Fixes #149: Changed `yii\base\Object` to `yii\base\BaseObject` * since elasticsearch 6, content type is mandatory (#150) since elasticsearch 6, content type is mandatory. Otherwise, requests will all fail. https://www.elastic.co/blog/strict-content-type-checking-for-elasticsearch-rest-requests * added CHANGELOG for #150 * Reset query results after calling refresh() method close #125 * Fixes case (#153) [skip ci] * Fix spelling (#165) [skip ci] * fix findAll and findOne to filter input to avoid passing manipulated condition * release version 2.0.5 * prepare for next release * Update README.md * docs/guide-ja updated [ci skip] (#178) * Removed redundant line from license [skip ci] * guide-ja revised [ci skip] * Fixed `count()` compatibility with PHP 7.2 do not call it on scalar values. fixes #180 * Translate into Russian (#194) [skip ci] * Improve Russian docs (#200) [skip ci] * Bug #201: Fixed infinite loop * Updated issue template [skip ci] * Made tests running again (#210) * Revert "Bug #201: Fixed infinite loop" This reverts commit aa22ffd. * Fixes #218: Comment out invalid syntax in sample [skip ci] (#219) * docs/guide-ja/mapping-indexing.md updated [ci skip] (#221) * Fixes #227: Fixed `Bad Request (#400): Unable to verify your data submission.` in debug details panel 'run query' * Travis adjustments (#228) * Use assertCount() in tests * Add missing relations to Order test model * Add note delete-by-query plugin (#158) * Fixes #117: Add support for `QueryInterface::emulateExecution()` * Specified versions that work
- Loading branch information
Showing
35 changed files
with
811 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
<!-- | ||
Please use this issue tracker for bugs and feature requests only. In case you need support please use one of | ||
Yii communities listed at https://github.com/yiisoft/yii2/wiki/communities | ||
--> | ||
|
||
### What steps will reproduce the problem? | ||
|
||
### What's expected? | ||
|
||
### What do you get instead? | ||
|
||
|
||
### Additional info | ||
|
||
| Q | A | ||
| ---------------- | --- | ||
| Yii vesion | | ||
| Yii version | | ||
| PHP version | | ||
| Operating system | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,8 @@ | |
* count will be fetched after pagination limit applying, which eliminates ability to verify if requested page number | ||
* actually exist. Data provider disables [[yii\data\Pagination::validatePage]] automatically because of this. | ||
* | ||
* @property array $queryResults the query results. | ||
* @property array $aggregations all aggregations results. | ||
* @property array $aggregations All aggregations results. This property is read-only. | ||
* @property array $queryResults Full query results. | ||
* | ||
* @author Paul Klimov <[email protected]> | ||
* @since 2.0.5 | ||
|
@@ -95,14 +95,15 @@ protected function prepareModels() | |
$query->addOrderBy($sort->getOrders()); | ||
} | ||
|
||
$results = $query->search($this->db); | ||
$this->setQueryResults($results); | ||
|
||
if ($pagination !== false) { | ||
$pagination->totalCount = $this->getTotalCount(); | ||
if (is_array(($results = $query->search($this->db)))) { | ||
$this->setQueryResults($results); | ||
if ($pagination !== false) { | ||
$pagination->totalCount = $this->getTotalCount(); | ||
} | ||
return $results['hits']['hits']; | ||
} | ||
|
||
return $results['hits']['hits']; | ||
$this->setQueryResults([]); | ||
return []; | ||
} | ||
|
||
/** | ||
|
@@ -115,7 +116,7 @@ protected function prepareTotalCount() | |
} | ||
|
||
$results = $this->getQueryResults(); | ||
return (int)$results['hits']['total']; | ||
return isset($results['hits']['total']) ? (int)$results['hits']['total'] : 0; | ||
} | ||
|
||
/** | ||
|
@@ -157,4 +158,13 @@ protected function prepareKeys($models) | |
return array_keys($models); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function refresh() | ||
{ | ||
parent::refresh(); | ||
$this->_queryResults = null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.