Search

GA
POST

Perform a search against a document index.

Note: Uses a base url of https://predict.vellum.ai.

Request

This endpoint expects an object.
query
stringRequired
The query to search for.
index_id
stringOptional

The ID of the index to search against. Must provide either this or index_name.

index_name
stringOptional

The name of the index to search against. Must provide either this or index_id.

options
objectOptional
Configuration options for the search.

Response

This endpoint returns an object
results
list of objects
The results of the search. Each result represents a chunk that matches the search query.
POST
1curl -X POST https://predict.vellum.ai/v1/search \
2 -H "X_API_KEY: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "query": "query"
6}'
200
Successful
1{
2 "results": [
3 {
4 "text": "text",
5 "score": 1.1,
6 "keywords": [
7 "keywords"
8 ],
9 "document": {
10 "id": "id",
11 "label": "label"
12 }
13 }
14 ]
15}