Full-Text Search Examples全文搜索示例
This section provides examples for building an aggregation pipeline to perform a full-text search on one or more fields of documents in a collection.本节提供了构建聚合管道以对集合中文档的一个或多个字段执行全文搜索的示例。
The examples leverage Lucene-based search indexes delivered by Atlas Search. 这些示例利用了Atlas search提供的基于Lucene的搜索索引。Consequently, using these aggregations is only possible with an Atlas Cluster rather than a self-installed MongoDB deployment.因此,使用这些聚合只能在Atlas集群中使用,而不能在自行安装的MongoDB部署中使用。
Atlas Search makes adding fast relevance-based full-text search to your applications easy. Atlas Search使您可以轻松地在应用程序中添加基于相关性的快速全文搜索。Atlas Search deploys an Apache Lucene index next to your database, automatically handling data and schema synchronisation between the source collection and this new search index. AtlasSearch在数据库旁边部署了一个ApacheLucene索引,自动处理源集合和这个新搜索索引之间的数据和模式同步。Atlas Search provides fuzzy matching; auto-complete; fast facets and counts; highlighting; relevance scoring; geospatial queries; and synonyms, all backed by support for multiple language analysers. Atlas Search提供模糊匹配;自动完成;快速刻面和计数;突出显示;相关性评分;地理空间查询;和同义词,所有这些都有对多语言分析器的支持。You reduce your cognitive load by invoking searches via the regular MongoDB drivers and Aggregations API rather than a 3rd party Lucene API.通过常规MongoDB驱动程序和Aggregations API而不是第三方Lucene API调用搜索,可以减少认知负荷。
With the Atlas platform's integration of database, search engine, and synchronisation pipeline into a single, unified, and fully managed service, you can quickly build search features into your applications. 通过Atlas平台将数据库、搜索引擎和同步管道集成到一个单一、一致性和完全管理的服务中,您可以在应用程序中快速构建搜索功能。Consequently, this ease of use and its performance and functionality advantages mean you should use Atlas Search over MongoDB's 因此,这种易用性及其性能和功能优势意味着,在Atlas中运行数据库时,应该使用Atlas Search而不是MongoDB的$text and $regex query operators when running your database in Atlas.$text和$regex查询运算符。