Skip to content

Commit ff654ef

Browse files
committed
Clean ListSearchIndex
1 parent 92cfc7f commit ff654ef

File tree

5 files changed

+57
-315
lines changed

5 files changed

+57
-315
lines changed

src/Collection.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,17 +1016,18 @@ public function listIndexes(array $options = [])
10161016
* Returns information for all indexes for the collection.
10171017
*
10181018
* @see ListSearchIndexes::__construct() for supported aggregation and list options
1019-
* @return IndexInfoIterator
1019+
* @return Traversable
10201020
* @throws InvalidArgumentException for parameter/option parsing errors
10211021
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
10221022
*/
1023-
public function listSearchIndexes(string $name, array $aggregationOptions = [], array $listIndexOptions = [])
1023+
public function listSearchIndexes(string $name, array $aggregationOptions = [], array $listIndexOptions = []): Traversable
10241024
{
1025+
$filter = [];
10251026
if ($name) {
1026-
$listIndexOptions += ['name' => $name];
1027+
$filter += ['name' => $name];
10271028
}
10281029

1029-
$operation = new ListSearchIndexes($this->databaseName, $this->collectionName, $aggregationOptions, $listIndexOptions);
1030+
$operation = new ListSearchIndexes($this->databaseName, $this->collectionName, $filter, $aggregationOptions + $listIndexOptions);
10301031
$server = select_server($this->manager, $listIndexOptions);
10311032

10321033
return $operation->execute($server);

src/Model/SearchIndexInfo.php

Lines changed: 0 additions & 155 deletions
This file was deleted.

src/Model/SearchIndexInfoIterator.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/Model/SearchIndexInfoIteratorIterator.php

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)