自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
AppSearch
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
AppSearch 是一种设备端索引编制和结构化搜索引擎,在 Android 12 中以 APEX 的形式提供。在 Android 13 中,AppSearch 作为 Mainline 模块提供。
动机
为了确保在整个 Android 生态系统中一致地实现 AppSearch 并支持可更新性。
优势:
- 支持通过 Play 商店更新 AppSearch
- 可确保符合 AppSearch CDD 要求
详细信息
- 通过 AppSearch API 收集的数据仍会保留在用户设备上(但汇总的指标数据除外,这些数据将用于性能优化目的)。
- 一种 I/O 占用率低的移动设备优先快速存储实现
- 快速高效地对大型数据集进行索引编制和查询
- 支持多种语言,例如英语、西班牙语和 CJKT
- 相关性排名和使用情况评分
AppSearch 架构
图 1 着重展示了 AppSearch 概念以及系统服务进程的边界。
图 1. AppSearch 模块架构
模块边界
请参阅图 1 中的模块架构图。
此模块的主要函数包含在 APEX 软件包 com.android.appsearch
中。
依赖项
- libicu
- libprotobuf-cpp-lite
- ndk
自定义
此模块不可自定义。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-10。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-03-10。"],[],[],null,["# AppSearch, an on-device indexing and structured search engine, was shipped as\nan APEX in Android 12. In Android\n13, AppSearch is shipped as a Mainline module.\n\nMotivation\n----------\n\nTo ensure a consistent implementation of AppSearch across the Android ecosystem\nand support updateability.\n\nBenefits:\n\n- Allow updating AppSearch via Play Store\n- Ensure compliance with the AppSearch CDD requirements\n\nDetails\n-------\n\n- Data collected through AppSearch APIs remains on the user's device (except aggregated metrics data, which is used for performance optimization purposes).\n- A fast, mobile-first storage implementation with low I/O use\n- Highly efficient indexing and querying over large data sets\n- Multi-language support, such as English, Spanish and CJKT\n- Relevance ranking and usage scoring\n\nAppSearch architecture\n----------------------\n\nFigure 1 highlights AppSearch concepts as well as the system service\nprocess boundary.\n\n**Figure 1.** AppSearch module architecture\n\nModule boundary\n---------------\n\n- AppSearch Mainline Apex - `com.android.appsearch`\n\n - AppSearch API surface (Java)\n - Code Location: `frameworks/base/apex/appsearch/framework`\n - Process: \u003cvar translate=\"no\"\u003eBOOT_CLASS_PATH\u003c/var\u003e\n - AppSearchManagerService (Java)\n - Code Location: `frameworks/base/apex/appsearch/service`\n - Process: system_server\n - Icing Native library (C++)\n - Code Location: `external/icing`\n - Process: system_server\n- HAL Interface/Implementations (C++)\n\n - N/A\n\nRefer to the module architecture diagram in Figure 1.\n\nPackage format\n--------------\n\nThe main functions of this module are included in the APEX package\n`com.android.appsearch`.\n\nDependencies\n------------\n\n- libicu\n- libprotobuf-cpp-lite\n- ndk\n\nCustomization\n-------------\n\nThis module is not customizable."]]