[go: nahoru, domu]

tree: 179d6941cd26207a3fa6c2598d5fda219c86e4eb [path history] [tgz]
  1. arc/
  2. common/
  3. essential_search/
  4. files/
  5. games/
  6. local_image_search/
  7. manatee/
  8. omnibox/
  9. ranking/
  10. system_info/
  11. test/
  12. util/
  13. app_discovery_metrics_manager.cc
  14. app_discovery_metrics_manager.h
  15. app_discovery_metrics_manager_unittest.cc
  16. app_result.cc
  17. app_result.h
  18. app_search_data_source.cc
  19. app_search_data_source.h
  20. app_search_provider.cc
  21. app_search_provider.h
  22. app_search_provider_test_base.cc
  23. app_search_provider_test_base.h
  24. app_search_provider_unittest.cc
  25. app_service_app_result.cc
  26. app_service_app_result.h
  27. app_shortcuts_search_provider.cc
  28. app_shortcuts_search_provider.h
  29. app_shortcuts_search_result.cc
  30. app_shortcuts_search_result.h
  31. app_zero_state_provider.cc
  32. app_zero_state_provider.h
  33. app_zero_state_provider_unittest.cc
  34. assistant_text_search_provider.cc
  35. assistant_text_search_provider.h
  36. assistant_text_search_provider_unittest.cc
  37. burn_in_controller.cc
  38. burn_in_controller.h
  39. chrome_search_result.cc
  40. chrome_search_result.h
  41. chrome_search_result_unittest.cc
  42. DEPS
  43. desks_admin_template_provider.cc
  44. desks_admin_template_provider.h
  45. desks_admin_template_provider_unittest.cc
  46. federated_metrics_manager.cc
  47. federated_metrics_manager.h
  48. federated_metrics_manager_unittest.cc
  49. help_app_provider.cc
  50. help_app_provider.h
  51. help_app_provider_unittest.cc
  52. help_app_search_browsertest.cc
  53. help_app_zero_state_provider.cc
  54. help_app_zero_state_provider.h
  55. help_app_zero_state_provider_unittest.cc
  56. keyboard_shortcut_data.cc
  57. keyboard_shortcut_data.h
  58. keyboard_shortcut_provider.cc
  59. keyboard_shortcut_provider.h
  60. keyboard_shortcut_provider_unittest.cc
  61. keyboard_shortcut_result.cc
  62. keyboard_shortcut_result.h
  63. keyboard_shortcut_result_unittest.cc
  64. os_settings_provider.cc
  65. os_settings_provider.h
  66. os_settings_provider_unittest.cc
  67. OWNERS
  68. personalization_provider.cc
  69. personalization_provider.h
  70. personalization_provider_unittest.cc
  71. README.md
  72. scoring.cc
  73. scoring.h
  74. search_controller.cc
  75. search_controller.h
  76. search_controller_factory.cc
  77. search_controller_factory.h
  78. search_controller_unittest.cc
  79. search_engine.cc
  80. search_engine.h
  81. search_engine_unittest.cc
  82. search_features.cc
  83. search_features.h
  84. search_metrics_manager.cc
  85. search_metrics_manager.h
  86. search_metrics_manager_unittest.cc
  87. search_metrics_util.cc
  88. search_metrics_util.h
  89. search_provider.cc
  90. search_provider.h
  91. search_session_metrics_manager.cc
  92. search_session_metrics_manager.h
  93. search_session_metrics_manager_unittest.cc
  94. types.cc
  95. types.h
chrome/browser/ash/app_list/search/README.md

About

This folder contains the backend implementation of Chrome OS launcher search.

Overview of search infrastructure

Important classes

Core

  • SearchController. This controls all the core search functions such as starting a search, collecting results, ranking and publishing. Implemented by SearchControllerImplNew.

    To interact with the frontend, it calls the AppListController and AppListModelUpdater, and is called by the AppListClient.

  • SearchProvider. The base class for all search providers. Each search provider typically handles one type of result, such as settings, apps or files. Some search providers implement their search function locally, while others call out to further backends.

  • SearchControllerFactory. Responsible for the creation of the search controller and its providers at start-up time.

  • ChromeSearchResult. The base class for all search results. Each ChromeSearchResult contains the information associated with one result. This information is stored in a SearchResultMetadata object which is piped to the frontend code.

Ranking

Ranking is the process of assigning scores to each result and category to determine their final display order. Located inside the ranking/ subdirectory.

  • RankerManager. This owns the ranking stack and determines the order of ranking steps.
  • Ranker. The base class for all rankers. Rankers can be used for all kinds of post-processing steps, including but not limited to ranking.

Metrics

  • AppListNotifierImpl. Located in the parent directory chrome/browser/ash/app_list/. Contains a state machine that converts raw UI events into information such as impressions and launches.
  • SearchMetricsManager. Observes the AppListNotifier and logs metrics accordingly.

Life of a search query

  1. The user types a query into the launcher search box. This filters through UI code until it eventually reaches SearchController::StartSearch(query).
  2. The SearchController forwards this query to its various search providers.
  3. Search providers return their results asynchronously.
  4. The SearchController collects these results and performs ranking on the results and their categories.
  5. Results are published to the UI.

Steps #3-5 may be repeated several times due to the asynchronous nature of #3. The BurnInController contains timing logic to reduce the UI effect of results popping in.

Training may be performed:

  1. The user clicks on a result.
  2. The SearchController forwards this information to its various search providers and rankers, which can use this information to inform future searches and ranking.

Life of zero state

Zero state is the UI shown before the user types any query. It consists of the Continue section (recent files), the recent apps row, as well as the app grid. The SearchController handles ranking for continue files and recent apps.

Steps #1-4 closely mirror query search, but publishing is handled differently.

  1. The user opens the launcher. This eventually reaches SearchController::StartZeroState(callback, timeout).
    • The UI blocks itself until callback is run, which by contract should happen no later than timeout.
  2. The SearchController forwards this request to its various zero state providers.
  3. Providers return their results asynchronously.
  4. The SearchController collects these results and performs ranking on the results and their categories.
  5. Once either of the following two conditions is satisfied, the SearchController will publish any existing results and unblock the UI:
    • timeout has elapsed,
    • All zero state providers have returned.
  6. If there are any providers still pending, the SearchController waits until all of them have returned and publishes results once more to the UI.

The most common situation is that recent apps return before the timeout, but the continue files providers return later.

Training may be performed, the same as with query search.