3232use MacFJA \RediSearch \Redis \Command \AggregateCommand \SortByOption ;
3333use MacFJA \RediSearch \Redis \Command \AggregateCommand \WithCursor ;
3434use MacFJA \RediSearch \Redis \Command \Option \CommandOption ;
35+ use MacFJA \RediSearch \Redis \Command \Option \CustomValidatorOption as CV ;
3536use MacFJA \RediSearch \Redis \Command \Option \FlagOption ;
3637use MacFJA \RediSearch \Redis \Command \Option \NamedOption ;
3738use MacFJA \RediSearch \Redis \Command \Option \NamelessOption ;
@@ -58,6 +59,7 @@ public function __construct(string $rediSearchVersion = self::MIN_IMPLEMENTED_VE
5859 'query ' => new NamelessOption (null , '>=2.0.0 ' ),
5960 'verbatim ' => new FlagOption ('VERBATIM ' , false , '>= 2.0.0 ' ),
6061 'load ' => new NumberedOption ('LOAD ' , null , '>=2.0.0 ' ),
62+ 'loadall ' => CV ::allowedValues (new NamedOption ('LOAD ' , null , '>=2.0.13 ' ), ['ALL ' ]),
6163 'groupby ' => [],
6264 'sortby ' => new SortByOption (),
6365 'apply ' => [],
@@ -157,6 +159,15 @@ public function setLoad(string ...$field): self
157159 return $ this ;
158160 }
159161
162+ public function setLoadAll (): self
163+ {
164+ $ this ->options ['load ' ]->setArguments (null );
165+ $ this ->options ['loadall ' ]->setValue ('ALL ' );
166+ $ this ->lastAdded = $ this ->options ['loadall ' ];
167+
168+ return $ this ;
169+ }
170+
160171 public function setWithCursor (?int $ count = null , ?int $ maxIdle = null ): self
161172 {
162173 $ this ->options ['cursor ' ]
0 commit comments