File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ Yii Framework 2 Elasticsearch extension Change Log
66
77- Bug #344 : Disabled JSON pretty print for ElasticSearch bulk API (rhertogh)
88- Bug #350 : Remove deprecated code, set $pagination->totalCount (lav45)
9+ - Bug #352 : Add support for query parameter ` search_after ` to paginate over large datasets (lubosdz)
910
1011
11122.1.4 May 22, 2023
Original file line number Diff line number Diff line change @@ -236,6 +236,12 @@ class Query extends Component implements QueryInterface
236236 * @since 2.0.5
237237 */
238238 public $ explain ;
239+ /**
240+ * @var array Allows pagination of large datasets.
241+ * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/paginate-search-results.html#search-after
242+ * @since 2.1.5
243+ */
244+ public $ search_after = [];
239245
240246
241247 /**
Original file line number Diff line number Diff line change @@ -109,6 +109,9 @@ public function build($query)
109109 if (!empty ($ query ->collapse )) {
110110 $ parts ['collapse ' ] = $ query ->collapse ;
111111 }
112+ if ($ query ->search_after ) {
113+ $ parts ['search_after ' ] = $ query ->search_after ;
114+ }
112115
113116 $ sort = $ this ->buildOrderBy ($ query ->orderBy );
114117 if (!empty ($ sort )) {
You can’t perform that action at this time.
0 commit comments