Engines
Create, delete, and list your Engines.
Engines created using the API are created as API-based Engines:
You will not be able to run Crawler Operations upon them
You must use the Document Indexing endpoint to index documents.
The following instructions available within this reference:
| Engine Type | Supported? |
|---|---|
| Crawler-based Engine | YES |
| API-based Engine | YES |
Read more about Crawler-based Engines and API-based Engines within the API Overview.
Language List
For more information on languages see language optimization.
| Language | Language Code, ISO 639-1 and ISO 3166-1. |
| "Brazilian Portuguese" | pt-br |
| “Chinese" | zh |
| "Danish"" | da |
| “Dutch" | nl |
| “English" | en |
| "French" | fr |
| “German" | de |
| "Italian" | it |
| "Japanese" | ja |
| "Korean | ko |
| “Portuguese" | pt |
| “Russian" | ru |
| “Spanish" | es |
| “Thai" | th |
| "Universal" | null |
List Engines
List the Engines that you have created.
List one Engine or list all Engines.
- per_page
- optional
- The number of results per page. Defaults to 50.
- page
- optional
- The page to fetch. Defaults to 1.
List an Engine
bookstore.
curl -X GET 'https://api.swiftype.com/api/v1/engines/bookstore.json?auth_token=YOUR_API_KEY'
[
{
"name": "bookstore",
"slug": "bookstore",
"key": "7DHxRvRLzWYWvsmzsGus",
"id": "253b7f582ed960a803000001",
"_id": "253b7f582ed960a803000001",
"updated_at": "2015-09-19T22:51:53Z",
"document_count": 56
}
]
List all Engines
curl -X GET 'https://api.swiftype.com/api/v1/engines.json?auth_token=YOUR_API_KEY'
[
{
"name": "Example Engine 1",
"slug": "example-engine-1",
"key": "7HDxRvRLzWYWvsmzsGus",
"id": "523b7f582ed960a803000001",
"_id": "523b7f582ed960a803000001",
"updated_at": "2013-09-19T22:51:53Z",
"document_count": 56
},
{
"name": "Example Engine 2",
"slug": "example-engine-2",
"key": "gq2QknfBiv9bd11TZAdq",
"id": "52420fbd2ed960178b000004",
"_id": "52420fbd2ed960178b000004",
"updated_at": "2013-09-25T02:18:43Z",
"document_count": 130
},
{
"name": "Example Engine 3",
"slug": "example-engine-3",
"key": "vABWdVfHeFZSxgEJwgVF",
"id": "15c1fcbd2ed960d45200000c",
"_id": "15c1fcbd2ed960d45200000c",
"updated_at": "2015-09-19T23:03:26Z",
"document_count": 2
}
]
Create Engines
Create an API-based Engine.
Defaults to Universal language if no language parameter is included.
A HTTP 400 error will appear if the Engine is not valid: missing a name, has a non-unique name.
- name
- required
- Provide a name for your Engine.
- language
- optional
- Defaults to
null, or Universal. Specify a code from the language list to optimize for the associated language.
Create Engine, Default Language
bookstore.
curl -X POST 'https://api.swiftype.com/api/v1/engines.json' \
-H 'Content-Type: application/json' \
-d '{
"auth_token": "YOUR_API_KEY",
"engine": {"name": "bookstore"}
}'
{
"name": "bookstore",
"slug": "bookstore",
"language": null,
"key": "JHpTKzqozsps3fq9dcRs",
"id": "52843c9a2ed96076f600000b",
"_id": "52843c9a2ed96076f600000b",
"updated_at": "2013-11-14T02:59:38Z",
"document_count": 0
}
Create Engine, Language Optimized
Create a language optimized Engine.
See the language list for supported languages.
french-book-store.
curl -X POST 'https://api.swiftype.com/api/v1/engines.json' \
-H 'Content-Type: application/json' \
-d '{
"auth_token": "YOUR_API_KEY",
"engine": {"name": "french-book-store", "language": "fr"}
}'
{
"name": "french-book-store",
"slug": "french-book-store",
"language": "fr",
"key": "JHpTKzqozsps3fq9dcRs",
"id": "52843c9a2ed96076f600000b",
"_id": "52843c9a2ed96076f600000b",
"updated_at": "2013-11-14T02:59:38Z",
"document_count": 0
}
Destroy an Engine
Be careful! Destruction is permanent.
Note that the :engine_id is the Site Search Engine ID or the Engine slug.
The response will be HTTP 204 No Content if the request succeeds.
- name
- required
- Your Engine Slug. Find the slug within your dashboard or query the Engines endpoint.
bookstore.
curl -X DELETE 'https://api.swiftype.com/api/v1/engines/bookstore?auth_token=YOUR_API_KEY'
Stuck? Looking for help? Contact support or check out the Site Search community forum!