1.17版本新增。
定义
MongoDB\Collection::listSearchIndexes()获取collection中一个或多个搜索索引的索引信息。
function listSearchIndexes(array $options = []): Countable&Iterator This command can only be run on a deployment hosted on MongoDB Atlas and requires an Atlas cluster tier of at least M10. A Local Atlas Deployment can also be used for development.
参数
$options: array指定所需选项的数组。
名称类型说明batchSize
整型
索引列表中返回的每个批处理中的最大文档数,适用于
aggregate命令。默认下,aggregate命令的初始批处理大小为101个文档,后续每个批处理的最大大小为 16 兆字节 (MiB)。此选项可以实施小于 16 MiB 的限制,但不能强制执行大于 MiB 的限制。如果将batchSize设立为导致批量大于 16 MiB 的限制,则此选项无效。编解码器
MongoDB\Codec\DocumentCodec
排序规则
数组|对象
Collation allows users to specify language-specific rules for string comparison, such as rules for lettercase and accent marks. When specifying collation, the
localefield is mandatory; all other collation fields are optional. For descriptions of the fields, see Collation Document.comment
混合
maxTimeMS
整型
The cumulative time limit in milliseconds for processing operations on the cursor. MongoDB aborts the operation at the earliest following interrupt point.
名称
字符串
要返回信息的索引名称。
如果未指定名称,则返回collection上所有索引的信息。
事务外的
Read concern to use for the operation. Defaults to the collection's read concern.
无法将单个操作的读关注(read concern)指定为ACID 事务的一部分。相反,请在启动ACID 事务时设立
readConcern选项。readPreference
Read preference to use for the operation. Defaults to the collection's read preference.
会话
与操作相关联的客户端会话。
typeMap
阵列
应用游标的类型映射,决定如何将BSON文档转换为PHP值。默认为集合的类型映射。
Return Values
文档列表,每个文档都描述了集合上的一个Atlas Search索引。 有关输出字段的详细信息,请参阅 MongoDB 手册中的$listSearchIndexes: Output 。
错误/异常
MongoDB\Exception\UnsupportedException,如果所选服务器使用了选项但不支持选项(例如collation、readConcern、writeConcern)。
MongoDB\Exception\InvalidArgumentException 用于与参数或选项解析相关的错误。
MongoDB\ 驱动程序\Exception\RuntimeException 用于扩展级别的其他错误(例如连接错误)。
另请参阅
MongoDB手册中的$listSearchIndexes聚合管道阶段参考
MongoDB Search documentation in the MongoDB Manual