Skip to content

Commit

Permalink
Documentation done, time to organise
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Carlino committed Jun 15, 2020
1 parent f4c5f1f commit dfab239
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ composer require "silverstripe/silverstripe-search-service"
* silverstripe/versioned
* symbiote/silverstripe-queuedjobs

## Before using

You must select which search service you will use after installing this module. If left undefined,
your `dev/build` process will throw a runtime error. See the [implementations documentation](docs/en/implementations.md) for more information about how to activate a search service.

## Documentation

See the [developer documentation](docs/en/index.md).
4 changes: 3 additions & 1 deletion docs/en/customising.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ step. The build step is invoked during `dev/build` or explicitly in the `SearchC

Configuration can include operations like creating/removing indexes, defining a schema, and more.

This method should rely heavily on the `IndexConfiguration` class to guide its operations.
This method should rely heavily on the `IndexConfiguration` class to guide its operations, along
with the `getOptions()` method of the `Field` objects, which can be used for adding arbitrary
configuration data to the index (e.g. data types).

```php
public function configure(): void
Expand Down
46 changes: 46 additions & 0 deletions docs/en/implementations.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,50 @@
# Implementations

This module is a set of abstractions for creating search-as-a-service integrations. This section
of the documentation covers the details of each one.

## Elastic AppSearch

This module comes bundled with an implementation for [Elastic AppSearch](https://www.elastic.co/app-search/). While most of the details are abstracted away in the `AppSearchService` class, there are some key things to know about configuring AppSearch.

### Activating AppSearch

To start using AppSearch, simply define an environment variable containing your private API key
and endpoint.

```
APP_SEARCH_ENDPOINT="https://abc123.app-search.ap-southeast-2.aws.found.io"
APP_SEARCH_API_KEY="private-abc123"
```

### Configuring AppSearch

The most notable configuration surface for AppSearch is the schema, which determines how data
is stored in your AppSearch index (engine). There are four types of data in AppSearch:

* Text (default)
* Date
* Number
* Geolocation

You can specify these data types in the `options` node of your fields.

```yaml
SilverStripe\SearchService\Service\IndexConfiguration:
indexes:
myindex:
includeClasses:
SilverStripe\CMS\Model\SiteTree:
fields:
title:
property: Title
options:
type: text
```
**Note**: Be careful about whimsically changing your schema. AppSearch may need to be fully
reindexed if you change the data type of a field.

0 comments on commit dfab239

Please sign in to comment.