Skip to content

Commit ff95541

Browse files
committed
Clean ListSearchIndex
1 parent 4b22fd4 commit ff95541

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
@@ -1018,17 +1018,18 @@ public function listIndexes(array $options = [])
10181018
* Returns information for all indexes for the collection.
10191019
*
10201020
* @see ListSearchIndexes::__construct() for supported aggregation and list options
1021-
* @return IndexInfoIterator
1021+
* @return Traversable
10221022
* @throws InvalidArgumentException for parameter/option parsing errors
10231023
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
10241024
*/
1025-
public function listSearchIndexes(string $name, array $aggregationOptions = [], array $listIndexOptions = [])
1025+
public function listSearchIndexes(string $name, array $aggregationOptions = [], array $listIndexOptions = []): Traversable
10261026
{
1027+
$filter = [];
10271028
if ($name) {
1028-
$listIndexOptions += ['name' => $name];
1029+
$filter += ['name' => $name];
10291030
}
10301031

1031-
$operation = new ListSearchIndexes($this->databaseName, $this->collectionName, $aggregationOptions, $listIndexOptions);
1032+
$operation = new ListSearchIndexes($this->databaseName, $this->collectionName, $filter, $aggregationOptions + $listIndexOptions);
10321033
$server = select_server($this->manager, $listIndexOptions);
10331034

10341035
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)