You are here

INSTALL.txt in Search API Algolia 8

Same filename and directory in other branches
  1. 7 INSTALL.txt
  2. 2.0.x INSTALL.txt
INSTALLING MODULES AND LIBRARIES
--------------------------------
 * Download the module and all of its dependencies. Move them to the contributed
   modules location in your tree (e.g. /modules/ or /modules/contrib/).

 * Install Algolia search client PHP library from
   https://github.com/algolia/algoliasearch-client-php via command line
   `composer require algolia/algoliasearch-client-php`

 * Enable the module's dependencies on the modules admin page url (/admin/modules).


CONFIGURING SEARCH API SERVER AND INDEX
---------------------------------------

 * On the Search API administration page (/admin/config/search/search-api), add
   a new server, select backend "Algolia", and check the "Enabled" checkbox.
   In the "Configure Algolia backend" section, fill in your Application ID and
   API key found in your Algolia dashboard on https://www.algolia.com.

 * On the Search API administration page (/admin/config/search/search_api), add
   a new index, enable it and select the server you just created in the previous
   section. The index name provided will be used to create a new index on the
   Algolia platform. Please read the "Known problems" section of the README.txt
   file for the latest updates about the type of entity supported.

 * On the "Fields" tab of your index
   (/admin/config/search/search_api/index/[YOUR INDEX NAME]/fields), check all
   the fields you want to have indexed in the Algolia index. At the very least,
   the entity ID field for the indexed entity type needs to be checked off (nid
   for nodes, uid for users, etc.). Please read the "Known problems" section of
   the README.txt file for the latest updates about the type of fields
   supported.

 * On the "Processors" of your index
   (/admin/config/search/search_api/index/[YOUR INDEX NAME]/processors),
   select the processors you want to apply before the data is being sent to
   Algolia's servers. A good starting combination could be "Entity status"
   (allowing you to Exclude unpublished content, unpublished comments and
   inactive users from being indexed). Please read the "Known problems" section
   of the README.txt file for the latest updates about the type of processor
   supported.


INDEXING CONTENT
----------------
* On your newly created index page, (/admin/config/search/search_api/index/[YOUR
  INDEX NAME]), click the "Index now" button. You should start seeing content
  populating the index in the Algolia dashboard on https://www.algolia.com.

VIEWING CONTENT
---------------
* Indexed content can be viewed using Search API Views in Drupal. There are some
  naming conventions to follow to support sorting and autocomplete.

* When using multi-lingual Drupal, we need to create indexes with language code
  suffix. For instance if we have English and French, we should have indexes
  like PREFIX_en and PREFIX_fr where PREFIX could be anything like your
  environment - prod/stage/etc.

* For autocomplete, we need to use Query Suggestions feature of Algolia. We need
  to have query indexes like PREFIX_LANGCODE_query (or PREFIX_query if not
  multi-lingual)

* For sorting, Algolia uses replicas. To allow exposed sorting, we need to
  create replica for each exposed sort option. For this we need to follow the
  format PREFIX_LANGCODE_fieldname_direction. Here fieldname is internal keyword
  and direction is asc/desc.

* For facets, Algolia has separate setting. Administrators need to ensure facets
  configured in Drupal and in Algolia are the same.

File

INSTALL.txt
View source
  1. INSTALLING MODULES AND LIBRARIES
  2. --------------------------------
  3. * Download the module and all of its dependencies. Move them to the contributed
  4. modules location in your tree (e.g. /modules/ or /modules/contrib/).
  5. * Install Algolia search client PHP library from
  6. https://github.com/algolia/algoliasearch-client-php via command line
  7. `composer require algolia/algoliasearch-client-php`
  8. * Enable the module's dependencies on the modules admin page url (/admin/modules).
  9. CONFIGURING SEARCH API SERVER AND INDEX
  10. ---------------------------------------
  11. * On the Search API administration page (/admin/config/search/search-api), add
  12. a new server, select backend "Algolia", and check the "Enabled" checkbox.
  13. In the "Configure Algolia backend" section, fill in your Application ID and
  14. API key found in your Algolia dashboard on https://www.algolia.com.
  15. * On the Search API administration page (/admin/config/search/search_api), add
  16. a new index, enable it and select the server you just created in the previous
  17. section. The index name provided will be used to create a new index on the
  18. Algolia platform. Please read the "Known problems" section of the README.txt
  19. file for the latest updates about the type of entity supported.
  20. * On the "Fields" tab of your index
  21. (/admin/config/search/search_api/index/[YOUR INDEX NAME]/fields), check all
  22. the fields you want to have indexed in the Algolia index. At the very least,
  23. the entity ID field for the indexed entity type needs to be checked off (nid
  24. for nodes, uid for users, etc.). Please read the "Known problems" section of
  25. the README.txt file for the latest updates about the type of fields
  26. supported.
  27. * On the "Processors" of your index
  28. (/admin/config/search/search_api/index/[YOUR INDEX NAME]/processors),
  29. select the processors you want to apply before the data is being sent to
  30. Algolia's servers. A good starting combination could be "Entity status"
  31. (allowing you to Exclude unpublished content, unpublished comments and
  32. inactive users from being indexed). Please read the "Known problems" section
  33. of the README.txt file for the latest updates about the type of processor
  34. supported.
  35. INDEXING CONTENT
  36. ----------------
  37. * On your newly created index page, (/admin/config/search/search_api/index/[YOUR
  38. INDEX NAME]), click the "Index now" button. You should start seeing content
  39. populating the index in the Algolia dashboard on https://www.algolia.com.
  40. VIEWING CONTENT
  41. ---------------
  42. * Indexed content can be viewed using Search API Views in Drupal. There are some
  43. naming conventions to follow to support sorting and autocomplete.
  44. * When using multi-lingual Drupal, we need to create indexes with language code
  45. suffix. For instance if we have English and French, we should have indexes
  46. like PREFIX_en and PREFIX_fr where PREFIX could be anything like your
  47. environment - prod/stage/etc.
  48. * For autocomplete, we need to use Query Suggestions feature of Algolia. We need
  49. to have query indexes like PREFIX_LANGCODE_query (or PREFIX_query if not
  50. multi-lingual)
  51. * For sorting, Algolia uses replicas. To allow exposed sorting, we need to
  52. create replica for each exposed sort option. For this we need to follow the
  53. format PREFIX_LANGCODE_fieldname_direction. Here fieldname is internal keyword
  54. and direction is asc/desc.
  55. * For facets, Algolia has separate setting. Administrators need to ensure facets
  56. configured in Drupal and in Algolia are the same.