$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聚合管道阶段对Atlas集合中的一个或多个字段执行全文搜索。这些字段必须被MongoDB搜索索引覆盖。
For example, you can use 例如,您可以使用$search to perform the following types of operations:$search执行以下类型的操作:
Searches to match text fields with various patterns.搜索以匹配具有各种模式的文本字段。Fuzzy matches to find terms with spelling variations.模糊匹配以查找拼写变化的术语。Compound queries to combine multiple search conditions.组合多个搜索条件的复合查询。Relevance scoring to rank results.对结果进行相关性评分。Return snippets of matching text.返回匹配文本的片段。Vector searches to find documents using vector similarities.使用向量相似性进行向量搜索以查找文档。
For more details, see:有关更多详细信息,请参阅:
Index Definitions索引定义to learn more about creating and managing MongoDB Search indexes.了解有关创建和管理MongoDB搜索索引的更多信息。MongoDB Search Aggregation Pipeline StagesMongoDB搜索聚合管道阶段to learn more about the了解更多关于$searchpipeline stage syntax and usage.$search管道阶段语法和用法的信息。$search Operators$search运算符to learn more about the了解更多关于$searchaggregation pipeline stage operators.$search聚合管道阶段运算符的信息。