Type Resource

Path : /v1/type/{type name?}


Use this resource to create a manage data types within your search engine. You can use this resource to create, update and delete types. Deleting a data type will remove all indexed documents from the search engine.


Name Value Description
name String The display name of the type
default_title_field String The name of the field to use as the value of “title” in search responses
default_display_field String The name of the field to use as the value of “display” in search responses.
mapping String elasticsearch style mapping definition or a DragonGlass type definition.

Code Sample:

curl -X GET --user username:password curl -X POST --user username:password -d ‘{“name”: “New Type”]} curl -X PUT username:password -d ‘{“name”: “Changed Type Name”} curl -X PATH username:password -d ‘{“default_title_field”: “name”} curl -X DELETE --user username:password

Success response code:

  • 200 for GET, PUT.
  • 204 WILL be returned for DELETE.
  • 201 WILL be returned for POST operations (if successful) with the new resource’s URL specified in the Location header.

Error response code:

Error Code Reason
401 You did not provide authorization credentials
403 The credentials you provided were incorrect or not recognized