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.
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
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
{
"name": "cosmic-realms",
"mappings": [
{
"name": "type",
"type": "category"
},
{
"name": "name",
"type": "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
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
{
"name": "cosmic-realms",
"mappings": [
{
"name": "type",
"type": "category"
},
{
"name": "name",
"type": "name"
}
]
}
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
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
[
{
"name": "cosmic-realms",
"mappings": [
{
"name": "type",
"type": "category"
},
{
"name": "name",
"type": "name"
}
]
}
]
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
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
{
"name": "cosmic-realms"
}
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
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
{
"name": "cosmic-realms"
}