diff --git a/README.md b/README.md index afef7b9..0ca8cd3 100644 --- a/README.md +++ b/README.md @@ -2,41 +2,53 @@ ## Quick Start -1. Make sure you have a Typesense server running - +### 1. Make sure you have a Typesense server running You have two options: * Typesense Cloud * Local Machine / Self-Hosting -Please follow the guide to Typesense installation: https://typesense.org/docs/guide/install-typesense.html. +as per the [Search API documentation](https://www.drupal.org/docs/8/modules/search-api/getting-started/adding-a-server), selecting "Search API Typesense" as **Backend** option. + +#### DDEV Addon (Local Machine) + +If you are using DDEV for you local development environment you can install the _[ddev-typesense]_ addon. +You will have a _Typesense Docker container_ running in you local machine and a _Typesense dashboard_ available at +http://127.0.0.1:8109. + +[ddev-typesense]: https://github.com/kevinquillen/ddev-typesense -2. Install and enable the module as usual. +### 2. Install and enable the module +Install as you would normally install a contributed Drupal module. For further +information, see _[Installing Drupal Modules]_. -3. Create a new Search API Typesense server at `/admin/config/search/search-api/add-server` as per the [Search API documentation](https://www.drupal.org/docs/8/modules/search-api/getting-started/adding-a-server), selecting "Search API Typesense" as **Backend** option. +[Installing Drupal Modules]: https://www.drupal.org/docs/extending-drupal/installing-drupal-modules -4. Configure the backend with your Typesense server credentials. +### 3. Create a new Search API Typesense server +Open the Search Api setting page at `/admin/config/search/search-api/add-server` (see the [Search API documentation] +for more details) and select the "Search API Typesense" as **Backend** option. -To use the local Typesense server in a DDEV managed environment, you can use the following configuration: +Then, you must fill in the server credentials at the bottom of the same settings page. If you are using the DDEV addon, +as described in the first step above, you can use this configuration: * Admin API key: `ddev` -* Host: `search-api-typesense.ddev.site` +* Host: `typesense.(YOUR_DDEV_HOSTNAME)` (e.g. `typesense.my-project.ddev.site`) * Port: `8108` * Protocol: `https` -5. Create a new index at `/admin/config/search/search-api/add-index`, selecting the server configured at step 4. +[Search API documentation]: https://www.drupal.org/docs/8/modules/search-api/getting-started/adding-a-server -Then click on "Save and add fields". +### 4. Create a new index and add fields +Create a new index at `/admin/config/search/search-api/add-index` selecting the server configured at step 4. +Click on "Save and add fields", then select the fields you want to index and save. -6. Select the fields you want to index and save. +In the fields table, replace Search API datatype with Typesense datatype (for example `string` becomes `Typesense: string`). -7. In the fields table, replace Search API datatype with Typesense datatype (for example `string` becomes `Typesense: string`). +### 5. Configure the processors +Configure, if needed, the Typesense Schema processor at `/admin/config/search/search-api/index/{index_name}/processors`. -8. Configure, if needed, the Typesense Schema processor at `/admin/config/search/search-api/index/{index_name}/processors` - -9. Index content from the UI or cli. - -Now your brand-new index is a Typesense collection, that you can check from Typesense dashboard. +### 6. Index content from the UI or cli. +Now your brand-new index is a Typesense collection, that you can check from Typesense dashboard (see "DDEV Addon (Local Machine)" +at point 1.). ## Typesense documentation - You can find a clear and valuable documentation on the [Typesense API Reference](https://typesense.org/docs/latest/api/).