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
$curl -X POST https://predict.vellum.ai/v1/search \
> -H "X_API_KEY: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "query": "query"
>}'
Response
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}