Movatterモバイル変換


[0]ホーム

URL:


searchmobilefacetsautocompletespellcheckcrawlerrankingsweightssynonymsanalyticsengageapicustomizedocumentationinstallsetuptechnologycontentdomainsuserhistoryinfohomebusinesscartchartcontactemailactivateanalyticsaltanalyticsautocompletecartcontactcontentcrawlingcustomdocumentationdomainsemailengagefacetedhistoryinfoinstallmobilepersonquerybuildersearchsetupspellchecksynonymsweightsengage_search_termengage_related_contentengage_next_resultsengage_personalized_resultsengage_recent_resultssuccessaddarrow-downarrow-leftarrow-rightarrow-upcaret-downcaret-leftcaret-rightcaret-upcheckclosecontentconversions-smallconversionsdetailseditgridhelpsmall-infoerrorlivemagentominusmovephotopinpluspreviewrefreshsearchsettingssmall-homestatsubtracttexttrashunpinwordpressxalertcase_deflectionadvanced-permissionskeyword-detectionpredictive-aisso
App Search Documentation /app search:Engines
Engines

App Search API Clients

Engines

Engines can be language optimized. Read theLanguage Optimization guide.


Engines index documents and perform various search functions.

You may have multiple Engines per account - this endpoint will help you manage your various Engines.

Authentication

For authentication, theEngines endpoint requires...

  1. AHost Identifier:[HOST_IDENTIFIER]
  2. The name of yourEngine:[ENGINE]
  3. APrivate API Key:[PRIVATE_API_KEY]
curl -X GET 'https://[HOST_IDENTIFIER].api.swiftype.com/api/as/v1/engines' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer [PRIVATE_API_KEY]'

Retrieve an Engine

Retrieves an Engine byname. Returns a JSON object containing aname,type andlanguage property.

GET /api/as/v1/engines/{ENGINE_NAME}
Example
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
{  "name": "national-parks-demo",  "type": "default",  "language": "en"}

Example
NoJava example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoJava example available, showingcURL
{  "name": "national-parks-demo",  "type": "default",  "language": "en"}

Example
NoNode example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoNode example available, showingcURL
{  "name": "national-parks-demo",  "type": "default",  "language": "en"}

Example
NoRuby example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoRuby example available, showingcURL
{  "name": "national-parks-demo",  "type": "default",  "language": "en"}

Example
NoPython example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoPython example available, showingcURL
{  "name": "national-parks-demo",  "type": "default",  "language": "en"}

Example
NoJavascript example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoJavascript example available, showingcURL
{  "name": "national-parks-demo",  "type": "default",  "language": "en"}

List Engines

Retrieves all Engines that the API Key is scoped to access.

GET /api/as/v1/engines
page
optional
JSON object containingcurrent andsize, wherecurrent is the current page number andsize is the page size. The maximum forsize is25, and be will truncated if a largersize is requested. The default is the first page of engines with pagination at25.

You have two options as to how you might send in your parameters:

JSON Object

A JSON object...

Example - A JSON body containing thecurrent andsize parameters. Expects the first page of results, with 20 documents per result.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "page": {    "current": "1",    "size": "20"  }}'
Example Response
{  "meta": {    "page": {      "current": 1,      "total_pages": 1,      "total_results": 1,      "size": 20    }  },  "results": [    {      "name": "national-parks-demo",      "type": "default",      "language": null    }  ]}

Example - A JSON body containing thecurrent andsize parameters. Expects the first page of results, with 20 documents per result.
NoJava example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "page": {    "current": "1",    "size": "20"  }}'
Example Response
NoJava example available, showingcURL
{  "meta": {    "page": {      "current": 1,      "total_pages": 1,      "total_results": 1,      "size": 20    }  },  "results": [    {      "name": "national-parks-demo",      "type": "default",      "language": null    }  ]}

Example - A JSON body containing thecurrent andsize parameters. Expects the first page of results, with 20 documents per result.
NoNode example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "page": {    "current": "1",    "size": "20"  }}'
Example Response
NoNode example available, showingcURL
{  "meta": {    "page": {      "current": 1,      "total_pages": 1,      "total_results": 1,      "size": 20    }  },  "results": [    {      "name": "national-parks-demo",      "type": "default",      "language": null    }  ]}

Example - A JSON body containing thecurrent andsize parameters. Expects the first page of results, with 20 documents per result.
NoRuby example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "page": {    "current": "1",    "size": "20"  }}'
Example Response
NoRuby example available, showingcURL
{  "meta": {    "page": {      "current": 1,      "total_pages": 1,      "total_results": 1,      "size": 20    }  },  "results": [    {      "name": "national-parks-demo",      "type": "default",      "language": null    }  ]}

Example - A JSON body containing thecurrent andsize parameters. Expects the first page of results, with 20 documents per result.
NoPython example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "page": {    "current": "1",    "size": "20"  }}'
Example Response
NoPython example available, showingcURL
{  "meta": {    "page": {      "current": 1,      "total_pages": 1,      "total_results": 1,      "size": 20    }  },  "results": [    {      "name": "national-parks-demo",      "type": "default",      "language": null    }  ]}

Example - A JSON body containing thecurrent andsize parameters. Expects the first page of results, with 20 documents per result.
NoJavascript example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "page": {    "current": "1",    "size": "20"  }}'
Example Response
NoJavascript example available, showingcURL
{  "meta": {    "page": {      "current": 1,      "total_pages": 1,      "total_results": 1,      "size": 20    }  },  "results": [    {      "name": "national-parks-demo",      "type": "default",      "language": null    }  ]}

Query Parameters

Rails-style query parameters:

Example - A parameterized query containing thecurrent andsize parameters. Expects the first page of results, with 20 documents per result.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines?page[size]=20&page[current]=1' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
{  "meta": {    "page": {      "current": 1,      "total_pages": 1,      "total_results": 1,      "size": 20    }  },  "results": [    {      "name": "national-parks-demo",      "type": "default",      "language": null    }  ]}

Example - A parameterized query containing thecurrent andsize parameters. Expects the first page of results, with 20 documents per result.
NoJava example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines?page[size]=20&page[current]=1' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoJava example available, showingcURL
{  "meta": {    "page": {      "current": 1,      "total_pages": 1,      "total_results": 1,      "size": 20    }  },  "results": [    {      "name": "national-parks-demo",      "type": "default",      "language": null    }  ]}

Example - A parameterized query containing thecurrent andsize parameters. Expects the first page of results, with 20 documents per result.
NoNode example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines?page[size]=20&page[current]=1' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoNode example available, showingcURL
{  "meta": {    "page": {      "current": 1,      "total_pages": 1,      "total_results": 1,      "size": 20    }  },  "results": [    {      "name": "national-parks-demo",      "type": "default",      "language": null    }  ]}

Example - A parameterized query containing thecurrent andsize parameters. Expects the first page of results, with 20 documents per result.
NoRuby example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines?page[size]=20&page[current]=1' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoRuby example available, showingcURL
{  "meta": {    "page": {      "current": 1,      "total_pages": 1,      "total_results": 1,      "size": 20    }  },  "results": [    {      "name": "national-parks-demo",      "type": "default",      "language": null    }  ]}

Example - A parameterized query containing thecurrent andsize parameters. Expects the first page of results, with 20 documents per result.
NoPython example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines?page[size]=20&page[current]=1' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoPython example available, showingcURL
{  "meta": {    "page": {      "current": 1,      "total_pages": 1,      "total_results": 1,      "size": 20    }  },  "results": [    {      "name": "national-parks-demo",      "type": "default",      "language": null    }  ]}

Example - A parameterized query containing thecurrent andsize parameters. Expects the first page of results, with 20 documents per result.
NoJavascript example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines?page[size]=20&page[current]=1' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoJavascript example available, showingcURL
{  "meta": {    "page": {      "current": 1,      "total_pages": 1,      "total_results": 1,      "size": 20    }  },  "results": [    {      "name": "national-parks-demo",      "type": "default",      "language": null    }  ]}

Create an Engine

Creates a new Engine object. Returns a JSON object with aname,type andlanguage property.

Reserved names include:new,collection,create_engine, andengine_limit.

POST /api/as/v1/engines
name
required
Name of the Engine. Can only contain lowercase letters, numbers, and hyphens.
language
optional
The language associated with a given Engine. Will default toUniversal, which will returnnull. To specify a language, see thelist of supported languages.
Example - Creating an Engine the defaultUniversal language.
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "name": "national-parks-demo"}'
Example Response
{  "name": "national-parks-demo",  "type": "default",  "language": null}

Example - Creating an Engine the defaultUniversal language.
NoJava example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "name": "national-parks-demo"}'
Example Response
NoJava example available, showingcURL
{  "name": "national-parks-demo",  "type": "default",  "language": null}

Example - Creating an Engine the defaultUniversal language.
NoNode example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "name": "national-parks-demo"}'
Example Response
NoNode example available, showingcURL
{  "name": "national-parks-demo",  "type": "default",  "language": null}

Example - Creating an Engine the defaultUniversal language.
NoRuby example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "name": "national-parks-demo"}'
Example Response
NoRuby example available, showingcURL
{  "name": "national-parks-demo",  "type": "default",  "language": null}

Example - Creating an Engine the defaultUniversal language.
NoPython example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "name": "national-parks-demo"}'
Example Response
NoPython example available, showingcURL
{  "name": "national-parks-demo",  "type": "default",  "language": null}

Example - Creating an Engine the defaultUniversal language.
NoJavascript example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "name": "national-parks-demo"}'
Example Response
NoJavascript example available, showingcURL
{  "name": "national-parks-demo",  "type": "default",  "language": null}

Example - Creating an Engine with theKorean language.
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "name": "national-parks-demo",  "language": "ko"}'
Example Response
{  "name": "korean-example",  "type": "default",  "language": "ko"}

Example - Creating an Engine with theKorean language.
NoJava example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "name": "national-parks-demo",  "language": "ko"}'
Example Response
NoJava example available, showingcURL
{  "name": "korean-example",  "type": "default",  "language": "ko"}

Example - Creating an Engine with theKorean language.
NoNode example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "name": "national-parks-demo",  "language": "ko"}'
Example Response
NoNode example available, showingcURL
{  "name": "korean-example",  "type": "default",  "language": "ko"}

Example - Creating an Engine with theKorean language.
NoRuby example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "name": "national-parks-demo",  "language": "ko"}'
Example Response
NoRuby example available, showingcURL
{  "name": "korean-example",  "type": "default",  "language": "ko"}

Example - Creating an Engine with theKorean language.
NoPython example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "name": "national-parks-demo",  "language": "ko"}'
Example Response
NoPython example available, showingcURL
{  "name": "korean-example",  "type": "default",  "language": "ko"}

Example - Creating an Engine with theKorean language.
NoJavascript example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \-d '{  "name": "national-parks-demo",  "language": "ko"}'
Example Response
NoJavascript example available, showingcURL
{  "name": "korean-example",  "type": "default",  "language": "ko"}

Delete an Engine

Delete an Engine by name. Returns a JSON object with adeleted property denoting whether the engine was successfully deleted.

DELETE /api/as/v1/engines/{ENGINE_NAME}
Example
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
{  "deleted": true}

Example
NoJava example available, showingcURL
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoJava example available, showingcURL
{  "deleted": true}

Example
NoNode example available, showingcURL
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoNode example available, showingcURL
{  "deleted": true}

Example
NoRuby example available, showingcURL
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoRuby example available, showingcURL
{  "deleted": true}

Example
NoPython example available, showingcURL
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoPython example available, showingcURL
{  "deleted": true}

Example
NoJavascript example available, showingcURL
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoJavascript example available, showingcURL
{  "deleted": true}

Supported Languages

Engines can be optimized for the following languages:

LanguageLanguage Code,ISO 639-1 andISO 3166-1.
"Brazilian Portuguese"pt-br
“Chinese"zh
"Danish""da
“Dutch"nl
“English"en
"French"fr
“German"de
"Italian"it
"Japanese"ja
"Koreanko
“Portuguese"pt
“Russian"ru
“Spanish"es
“Thai"th
"Universal"null

Errors

The endpoint will return an error if:

  • The API Key does not have read permissions for the requested Engine.
  • The requested Engine does not exist.
  • The Engine object is not well formed.
  • The API Key does not have permissions to create an Engine.
  • The Engine already exists and so cannot be created.

What's Next?

AnEngine is the beating heart of the search experience. Now you may want to learn more about how you can add, destroy and update, theDocuments - the life-blood - within them. If you want a deep look into how users are interacting with your engines, then theAnalytics andClickthrough endpoints are worth discovering.


Stuck? Looking for help?Contact support or check out theApp Search community forum!


[8]ページ先頭

©2009-2025 Movatter.jp