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:Schema
Schema

App Search API Clients

Schema

Want to start with the core concepts? Give ourIndexing Documents guide a read.


Alter the schema fields of your Engine.

Before you begin, familiarize yourself with the schema design principles within theAPI Overview.

Authentication

For authentication, theSchema 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/[ENGINE]/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer [PRIVATE_API_KEY]'

List Schema

GET /api/as/v1/engines/{ENGINE_NAME}/schema
Example - AGET request to return the whole schema.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "number"}

Example - AGET request to return the whole schema.
NoJava example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoJava example available, showingcURL
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "number"}

Example - AGET request to return the whole schema.
NoNode example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoNode example available, showingcURL
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "number"}

Example - AGET request to return the whole schema.
NoRuby example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoRuby example available, showingcURL
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "number"}

Example - AGET request to return the whole schema.
NoPython example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoPython example available, showingcURL
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "number"}

Example - AGET request to return the whole schema.
NoJavascript example available, showingcURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx'
Example Response
NoJavascript example available, showingcURL
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "number"}

Update Schema

Adjusting your schema begins a reindex of your data.
Your schema can not be changed during a reindex.


When updating a Schema, you can either...

Updates an Existing Schema

POST /api/as/v1/engines/{ENGINE_NAME}/schema
Example - APOST request that changes thesquare_km field fromnumber totext.
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx' \-d '{  "square_km": "text"}'
Example Response
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "text"}

Example - APOST request that changes thesquare_km field fromnumber totext.
NoJava example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx' \-d '{  "square_km": "text"}'
Example Response
NoJava example available, showingcURL
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "text"}

Example - APOST request that changes thesquare_km field fromnumber totext.
NoNode example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx' \-d '{  "square_km": "text"}'
Example Response
NoNode example available, showingcURL
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "text"}

Example - APOST request that changes thesquare_km field fromnumber totext.
NoRuby example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx' \-d '{  "square_km": "text"}'
Example Response
NoRuby example available, showingcURL
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "text"}

Example - APOST request that changes thesquare_km field fromnumber totext.
NoPython example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx' \-d '{  "square_km": "text"}'
Example Response
NoPython example available, showingcURL
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "text"}

Example - APOST request that changes thesquare_km field fromnumber totext.
NoJavascript example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx' \-d '{  "square_km": "text"}'
Example Response
NoJavascript example available, showingcURL
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "text"}

Creates a new Schema Field

You may have up to64 fields.

Fields cannot be named: external_id, engine_id, highlight, or, and, not, any, all, none.

Example - APOST request to add a newnumber field,square_mi.
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx' \-d '{  "square_mi": "number"}'
Example Response
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "number",  "square_mi": "number"}

Example - APOST request to add a newnumber field,square_mi.
NoJava example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx' \-d '{  "square_mi": "number"}'
Example Response
NoJava example available, showingcURL
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "number",  "square_mi": "number"}

Example - APOST request to add a newnumber field,square_mi.
NoNode example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx' \-d '{  "square_mi": "number"}'
Example Response
NoNode example available, showingcURL
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "number",  "square_mi": "number"}

Example - APOST request to add a newnumber field,square_mi.
NoRuby example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx' \-d '{  "square_mi": "number"}'
Example Response
NoRuby example available, showingcURL
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "number",  "square_mi": "number"}

Example - APOST request to add a newnumber field,square_mi.
NoPython example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx' \-d '{  "square_mi": "number"}'
Example Response
NoPython example available, showingcURL
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "number",  "square_mi": "number"}

Example - APOST request to add a newnumber field,square_mi.
NoJavascript example available, showingcURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/schema' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx' \-d '{  "square_mi": "number"}'
Example Response
NoJavascript example available, showingcURL
{  "description": "text",  "nps_link": "text",  "states": "text",  "title": "text",  "visitors": "number",  "world_heritage_site": "text",  "location": "geolocation",  "acres": "number",  "date_established": "date",  "square_km": "number",  "square_mi": "number"}

Errors

If one field fails validation then the entire set will fail.

Name indicates the name of the field. Type indicates the type of the field.

400 Error MessageSolution
"Type is not included in the list"The allowed types are:text,number,date,geolocation". Ensure that no spaces are included and only one of the four types is present. Watch out forinteger, which will not work - expectsnumber.
"Engine is reindexing."You may proceed with Schema changes once reindexing is complete. Time varies based on size of Engine.
"Name cannot contain whitespace"Can not contain any whitespace characters like'my field'
"Name cannot have a leading underscore"Can not start with a leading underscore like'_myfield'.
"Name cannot contain more than 64 characters"Very long field names are not allowed.
"Name cannot be a reserved field (external_id, engine_id, highlight, or, and, not, any, all, none)"These field names are reserved for your safety :). For example, trying to define an'all' filter for a field called'all' would be very difficult to understand.
"Name can only contain lowercase letters, numbers, and underscores"No dashes, capitals, strange characters or other such silliness!
"Name must contain a lowercase letter"You can not have a field withonly capital letters.
"Name must be unique"Each field name must be unique.

What's Next?

TheSchema endpoint is how you adjust your foundational data model. Now that you know how to make Schema changes via the API, you may be interested in exploring deeper intoIndexing Documents. Alternatively, you may be into some of the deeper analytics presented byCurations andClickthrough.


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


[8]ページ先頭

©2009-2025 Movatter.jp