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

Commit 23c8980

Browse files
authored
Added better client creation docs to README
1 parent e6842ee commit 23c8980

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,27 @@ The client can be instantiated using the `base_endpoint`, `api_key` and `use_htt
6464
)
6565
```
6666

67-
Note:
67+
Notes:
6868

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

73+
The `base_endpoint` must exclude the protocol and include the `api/as/v1` prefix. This can typically be found in the Credentials tab within the App Search Dashboard.
74+
75+
Set `use_https` to `True` or `False` depending how your server is configured. Often times it will be `False` when running in development on `localhost` and `True` for production environments.
76+
77+
The following is example of a configuration for Elastic Cloud:
78+
79+
```python
80+
>>> from elastic_app_search import Client
81+
>>> client = Client(
82+
base_endpoint='77bf13bc2e9948729af339a446b06ddcc.app-search.us-east-1.aws.found.io/api/as/v1',
83+
api_key='private-mu75psc5egt9ppzuycnc2mc3',
84+
use_https=True
85+
)
86+
```
87+
7388
#### Swiftype.com App Search users:
7489

7590
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.

0 commit comments

Comments
 (0)