$search aggregation pipeline stage performs a full-text search of the field or fields in an Atlas collection. The fields must be covered by a MongoDB Search index.
重要
$search聚合管道阶段可用于托管在以下位置上的集合:
MongoDB Enterprise 运行版本为 8.2 或更高版本的 Kubernetes 操作符 部署。
MongoDB Community 运行版本 8.2 或更高版本的部署。
要学习;了解更多信息,请参阅MongoDB Search。
例如,您可以使用 $search 来执行以下类型的操作:
搜索,以将文本字段与各种模式相匹配。
模糊匹配,以查找具有拼写变化的词语。
复合查询用于组合多个搜索条件。
相关性评分用于对结果进行排序。
返回匹配文本的片段。
向量搜索,以通过向量相似性查找文档。
如需更多详细信息,请参阅:
索引定义,学习;了解有关创建和管理MongoDB搜索索引的更多信息。
MongoDB Search Aggregation Pipeline Stages to learn more about the
$searchpipeline stage syntax and usage.$search Operators to learn more about the
$searchaggregation pipeline stage operators.