Indices

Indices are a crucial part of Sigmie - they are responsible for organizing and storing your documents. An index functions as a logical container that groups related documents. This section will guide you on how to interact with indices programmatically.

An index represents a collection of documents and serves as a container for categorizing your data.

Each index is identified by a unique name within Sigmie.

POST/v1/index/{index-name}

Create an Index

This endpoint allows you to create an Index with the given name.

Parameters

  • Name
    mappings
    Type
    array
    Description

    An array with the mappings.

  • Name
    mappings.*.name
    Type
    string
    Description

    The name of the mapping.

  • Name
    mappings.*.type
    Type
    string
    Description

    The specific type associated with the mapping.

    The available types are: name, address, float, int, text, price, long_text, sentence, tags, searchable_number, keyword, case_sensitive_keyword, identifier, html, email, category, path, long, completion, bool, date.

Security

  • Name
    admin
    Type
    API Key
    Description

    This endpoint requires an admin API key.

Returns

Retuns a JSON representation of the index.

Request

POST
/v1/index/{index-name}
curl -X GET https://sdfzzrn1amg3tbuxb.sigmie.app/v1/index/cosmic-realms \
  -H "Content-Type: application/json" \
  -H "X-Sigmie-API-Key: ${api_key}" \
  -H "X-Sigmie-Application: ${application_id}"
  -d '{
        "mappings": [
	        {
		        "name": "name",
		        "type": "name"
	        },
	        {
		        "name": "type",
		        "type": "category"
	        }
        ]
  }'

Response

202
Accepted
{
  "name": "cosmic-realms",
  "mappings": [
    {
      "name": "type",
      "type": "category"
    },
    {
      "name": "name",
      "type": "name"
    }
  ]
}

PUT/v1/index/{index-name}

Update an Index

This endpoint allows you to update an Index with the given name.

Parameters

  • Name
    mappings
    Type
    array
    Description

    An array with the mappings.

  • Name
    mappings.*.name
    Type
    string
    Description

    The name of the mapping.

  • Name
    mappings.*.type
    Type
    string
    Description

    The specific type associated with the mapping.

    The available types are: name, address, float, int, text, price, long_text, sentence, tags, searchable_number, keyword, case_sensitive_keyword, identifier, html, email, category, path, long, completion, bool, date.

Security

  • Name
    admin
    Type
    API Key
    Description

    This endpoint requires an admin API key.

Returns

Retuns a JSON representation of the index.

Request

PUT
/v1/index/{index-name}
curl -X PUT https://sdfzzrn1amg3tbuxb.sigmie.app/v1/index/cosmic-realms\
  -H "Content-Type: application/json" \
  -H "X-Sigmie-API-Key: ${api_key}" \
  -H "X-Sigmie-Application: ${application_id}"
  -d '{
        "mappings": [
	        {
		        "name": "name",
		        "type": "name"
	        },
	        {
		        "name": "type",
		        "type": "category"
	        }
        ]
  }'

Response

202
Accepted
{
  "name": "cosmic-realms",
  "mappings": [
    {
      "name": "type",
      "type": "category"
    },
    {
      "name": "name",
      "type": "name"
    }
  ]
}

GET/v1/index

List all Indices

This endpoint retrieves a list of all indices.

Parameters

  • Name
    filter
    Type
    string
    Description

    Use a wildcard pattern to filter the indices.

Security

  • Name
    admin
    Type
    API Key
    Description

    Access to this endpoint requires an admin API key.

Returns

Returns a JSON array containing details of all the indices.

Request

GET
/v1/index
curl -X GET https://sdfzzrn1amg3tbuxb.sigmie.app/v1/index\
  -H "Content-Type: application/json" \
  -H "X-Sigmie-API-Key: ${api_key}" \
  -H "X-Sigmie-Application: ${application_id}"

Response

200
Accepted
[
  {
    "name": "cosmic-realms",
    "mappings": [
      {
        "name": "type",
        "type": "category"
      },
      {
        "name": "name",
        "type": "name"
      }
    ]
  }
]

POST/v1/index/{index-name}/clear

Clear an Index

This endpoint allows you to clear all documents within an Index with the given name.

Parameters

No parameters.

Security

  • Name
    admin
    Type
    API Key
    Description

    This endpoint requires an admin API key.

Returns

Retuns a JSON with the index name.

Request

POST
/v1/index/{index-name}/clear
curl -X POST https://sdfzzrn1amg3tbuxb.sigmie.app/v1/index/cosmic-realms/clear \
  -H "Content-Type: application/json" \
  -H "X-Sigmie-API-Key: ${api_key}" \
  -H "X-Sigmie-Application: ${application_id}"

Response

202
Accepted
{
  "name": "cosmic-realms"
}

DELETE/v1/index/{index-name}

Delete an Index

This endpoint allows you to delete an Index with the given name.

Parameters

No parameters.

Security

  • Name
    admin
    Type
    API Key
    Description

    This endpoint requires an admin API key.

Returns

Returns a JSON with the index name.

Request

DELETE
/v1/index/{index-name}
curl -X DELETE https://sdfzzrn1amg3tbuxb.sigmie.app/v1/index/cosmic-realms \
  -H "Content-Type: application/json" \
  -H "X-Sigmie-API-Key: ${api_key}" \
  -H "X-Sigmie-Application: ${application_id}"

Response

200
Ok
{
  "name": "cosmic-realms"
}