README.txt 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. CONTENTS OF THIS FILE
  2. ---------------------
  3. * Introduction
  4. * Requirements
  5. * Installation
  6. * Configuration
  7. * Developers
  8. * Maintainers
  9. INTRODUCTION
  10. ------------
  11. This module provides a framework for easily creating searches on any entity
  12. known to Drupal, using any kind of search engine. For site administrators,
  13. it is a great alternative to other search solutions, since it already
  14. incorporates faceting support (with [1]) and the ability to use the Views module
  15. for displaying search results, filters, etc. Also, with the Apache Solr
  16. integration [2], a high-performance search engine is available for this module.
  17. [1] https://www.drupal.org/project/facets
  18. [2] https://www.drupal.org/project/search_api_solr
  19. Developers, on the other hand, will be impressed by the large flexibility and
  20. numerous ways of extension the module provides. Hence, the growing number of
  21. additional contrib modules, providing additional functionality or helping users
  22. customize some aspects of the search process.
  23. * For a full description of the module, visit the project page:
  24. https://www.drupal.org/project/search_api
  25. * To submit bug reports and feature suggestions, or to track changes:
  26. https://www.drupal.org/project/issues/search_api
  27. REQUIREMENTS
  28. ------------
  29. No other modules are required.
  30. INSTALLATION
  31. ------------
  32. Install as you would normally install a contributed Drupal module. For further
  33. information, see:
  34. https://www.drupal.org/docs/8/extending-drupal-8/installing-modules
  35. CONFIGURATION
  36. -------------
  37. After installation, for a quick start, just install the "Database Search
  38. Defaults" module provided with this project. This will automatically set up a
  39. search view for node content, using a database server for indexing.
  40. Otherwise, you need to enable at least a module providing integration with a
  41. search backend (like database, Solr, Elasticsearch, …). Possible options are
  42. listed at [3].
  43. Then, go to
  44. /admin/config/search/search-api
  45. on your site and create a search server and search index. Afterwards, you can
  46. create a view based on your index to enable users to search the content you
  47. configured to be indexed. More details are available online in the handbook [4].
  48. There, you can also find answers to frequently asked questions and common
  49. pitfalls to avoid.
  50. [3] https://www.drupal.org/docs/8/modules/search-api/getting-started/server-backends-and-features
  51. [4] https://www.drupal.org/docs/8/modules/search-api/getting-started
  52. DEVELOPERS
  53. ----------
  54. The Search API provides a lot of ways for developers to extend or customize the
  55. framework.
  56. - Hooks
  57. All available hooks are listed in search_api.api.php.
  58. - Events
  59. Currently, only the Search API's task system (for reliably executing necessary
  60. system tasks) makes use of events. Every time a task is executed, an event
  61. will be fired based on the task's type and the sub-system that scheduled the
  62. task is responsible for reacting to it. This system is extensible and can
  63. therefore also easily be used by contrib modules based on the Search API. For
  64. details, see the description of the \Drupal\search_api\Task\TaskManager class,
  65. and the other classes in src/Task for examples.
  66. - Plugins
  67. The Search API defines several plugin types, all listed in its
  68. search_api.plugin_type.yml file. Here is a list of them, along with the
  69. directory in which you can find there definition files (interface, plugin base
  70. and plugin manager):
  71. - Backends: src/Backend
  72. - Datasources: src/Datasource
  73. - Data types: src/DataType
  74. - Displays: src/Display
  75. - Parse modes: src/ParseMode
  76. - Processors: src/Processor
  77. - Trackers: src/Tracker
  78. The display plugins are a bit of a special case there, because they aren't
  79. really "extending" the framework, but are rather a way of telling the Search
  80. API (and all modules integrating with it) about search pages your module
  81. defines. They can then be used to provide, for example, faceting support for
  82. those pages. Therefore, if your module provides any search pages, it's a good
  83. idea to provide display plugins for them. For an example (for Views pages),
  84. see \Drupal\search_api\Plugin\search_api\display\ViewsPage.
  85. The handbook documentation for developers is available at [5].
  86. [5] https://www.drupal.org/docs/8/modules/search-api/developer-documentation
  87. To know which parts of the module can be relied upon as its public API, please
  88. read the "Drupal 8 backwards compatibility and internal API policy" [6] and the
  89. module's issue regarding potential module-specific changes to that policy [7].
  90. [6] https://www.drupal.org/core/d8-bc-policy
  91. [7] https://www.drupal.org/node/2871549
  92. SERVER BACKEND FEATURES
  93. -----------------------
  94. Server backend features are a way for other contrib modules to cleanly define
  95. ways in which the Search API can be extended. For more information, see [8].
  96. [8] https://www.drupal.org/docs/8/modules/search-api/getting-started/server-backends-and-features
  97. The Search API module itself currently defines one feature:
  98. - More Like This (search_api_mlt)
  99. This feature can be used to retrieve a list of search results that are similar
  100. to a given indexed item. A backend that supports this plugin has to recognize
  101. the "search_api_mlt" query option. If present, it contains an associative
  102. array with the following keys:
  103. - id: The Search API item ID (consisting of the datasource ID and the
  104. datasource-specific item ID – passing a plain entity ID will NOT work!) of
  105. the item for which similar results should be found.
  106. - fields: A simple array of fields which should be used for determining
  107. similarity. Backends can choose to ignore this field.
  108. - "field boosts": (optional) An associative array mapping fields to a numeric
  109. "boost" value that determines how important they should be considered when
  110. determining similarity. Backends can choose to ignore this field.
  111. The feature can be used in the UI via the "More like this" Views contextual
  112. filter.
  113. MAINTAINERS
  114. -----------
  115. Current maintainers:
  116. * Thomas Seidl (drunken monkey) - https://www.drupal.org/u/drunken-monkey