Skip to content

Commit a760570

Browse files
committed
[FEATURE] Introduce "from" operation
This allows for retrieving the results of a query operation starting at a given offset. Not yet tested with workspace compliance, but should do.
1 parent 9cb2fcd commit a760570

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Eel/ElasticSearchQueryBuilder.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ class ElasticSearchQueryBuilder implements \TYPO3\Eel\ProtectedContextAwareInter
5555
*/
5656
protected $limit;
5757

58+
/**
59+
* @var integer
60+
*/
61+
protected $from;
62+
5863
/**
5964
* The ElasticSearch request, as it is being built up.
6065
* @var array
@@ -209,6 +214,24 @@ public function limit($limit) {
209214
return $this;
210215
}
211216

217+
/**
218+
* output records starting at $from
219+
*
220+
*
221+
* @param integer $from
222+
* @return ElasticSearchQueryBuilder
223+
*/
224+
public function from($from) {
225+
if (!$from) {
226+
return $this;
227+
}
228+
229+
$this->from = $from;
230+
$this->request['from'] = $from;
231+
232+
return $this;
233+
}
234+
212235
/**
213236
* add an exact-match query for a given property
214237
*

0 commit comments

Comments
 (0)