Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

Commit

Permalink
Updating readme (#21)
Browse files Browse the repository at this point in the history
Emphasize on SMAS instead of SaaS in the doc.
  • Loading branch information
afoucret authored Feb 12, 2020
1 parent c498181 commit 4f7b279
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,44 @@ To guarantee compatibility, use the most recent version of this library within t

For example, for App Search `7.3`, use `7.3` of this library or above, but not `8.0`.

If you are a [SaaS](https://app.swiftype.com/as) user, simply use the most recent version of this library.
If you are using the [SaaS version available on swiftype.com](https://app.swiftype.com/as) of App Search, you should use the version 7.5.x of the client.

## Usage

### Instantiating a client

```python
>>> from elastic_app_search import Client
>>> host_identifier = 'host-c5s2mj'
>>> api_key = 'private-mu75psc5egt9ppzuycnc2mc3'
>>> client = Client(host_identifier, api_key)
```
Using this client assumes that you have already an instance of [Elastic App Search](https://www.elastic.co/products/app-search) up and running.

### Using with App Search Managed Deploys

The client can be configured to use a managed deploy by adjusting the `base_endpoint` and `use_https` parameters. Since managed deploys do not rely on a `host_identifier`, it can be omitted.
The client can be instantiated using the `base_endpoint`, `api_key` and `use_https` parameters:

```python
>>> from elastic_app_search import Client
>>> client = Client(
api_key='private-mu75psc5egt9ppzuycnc2mc3',
base_endpoint='localhost:3002/api/as/v1',
api_key='private-mu75psc5egt9ppzuycnc2mc3',
use_https=False
)
```

Note:

The `[api_key]` authenticates requests to the API.
You can use any key type with the client, however each has a different scope.
For more information on keys, check out the [documentation](https://swiftype.com/documentation/app-search/credentials).

#### Swiftype.com App Search users:

When using the [SaaS version available on swiftype.com](https://app.swiftype.com/as) of App Search, you can configure the client using your `host_identifier` instead of the `base_endpoint` parameter.
The `host_identifier` can be found within the [Credentials](https://app.swiftype.com/ascredentials) menu.

```python
>>> from elastic_app_search import Client
>>> host_identifier = 'host-c5s2mj'
>>> api_key = 'private-mu75psc5egt9ppzuycnc2mc3'
>>> client = Client(host_identifier, api_key)
```


### Indexing: Creating or Updating a Single Document

```python
Expand Down

0 comments on commit 4f7b279

Please sign in to comment.