Search Documents
Semantically search your embedded documents.
An API key for your org.
A Client ID for your org.
Return only a list of ids without any metadata.
The limit of possible reponses from your search. Max 100.
Index ID
Text
Image URL
Custom Embeddings
Subset of documents ids to match
curl --location --request POST 'https://api.getmetal.io/v1/search' \
--header 'Content-Type: application/json' \
--header 'x-metal-api-key: <api-key>' \
--header 'x-metal-client-id: <client-id>' \
--data-raw '{
"index": "index-id",
"text": "Generals gathered in their masses",
"filters": {
"and": [{
"field": "year",
"value": 1984,
"operator": "lte"
}],
"or": [{
"field": "name",
"value": "Iron Maiden",
"operator": "eq"
}, {
"field": "name",
"value": "Helloween",
"operator": "eq"
}]
}
}'
{
"data": [
{
"dist": "0.666",
"id": "1",
"text": "Eagle Fly Free",
"metadata": {
"name": "Helloween",
"year": 1984
},
"createdAt":"2023-08-22T18:30:11.493Z"
},
{
"id": "2",
"dist": "0.999",
"text": "The Trooper",
"metadata": {
"name": "Iron Maiden",
"year": 1978
},
"createdAt": "2023-08-10T11:44:53.010Z"
}
}
]
}
Auth Headers
An API key for your org.
A Client ID for your org.
Body
Index ID
Text
Image URL
Custom Embeddings
Subset of documents ids to match
The name of the filtereable field
The field value to search for.
Possible values: eq
, gt
, gte
, lt
, lte
The name of the filtereable field
The field value to search for.
Possible values: eq
, gt
, gte
, lt
, lte
Query
Return only a list of ids without any metadata.
The limit of possible reponses from your search. Max 100.
Response
Id of the embedding
Distance to the vector queried
Metadata of the embedding
curl --location --request POST 'https://api.getmetal.io/v1/search' \
--header 'Content-Type: application/json' \
--header 'x-metal-api-key: <api-key>' \
--header 'x-metal-client-id: <client-id>' \
--data-raw '{
"index": "index-id",
"text": "Generals gathered in their masses",
"filters": {
"and": [{
"field": "year",
"value": 1984,
"operator": "lte"
}],
"or": [{
"field": "name",
"value": "Iron Maiden",
"operator": "eq"
}, {
"field": "name",
"value": "Helloween",
"operator": "eq"
}]
}
}'
{
"data": [
{
"dist": "0.666",
"id": "1",
"text": "Eagle Fly Free",
"metadata": {
"name": "Helloween",
"year": 1984
},
"createdAt":"2023-08-22T18:30:11.493Z"
},
{
"id": "2",
"dist": "0.999",
"text": "The Trooper",
"metadata": {
"name": "Iron Maiden",
"year": 1978
},
"createdAt": "2023-08-10T11:44:53.010Z"
}
}
]
}