Skip to main content
GET
Search Index for Documents

Search Index for Documents

Search documents within an index using semantic search.

Endpoint

Description

Search documents within an index using semantic search. Returns matching documents with relevance scores, sorted by relevance.

Authentication

Required: API Key

Path Parameters

Query Parameters

Request Example

JavaScript/Node.js

Python

Response

Success Response (200)

Response Fields

Results Object

Match Object

Metadata Object

Error Responses

400 Bad Request

401 Unauthorized

403 Forbidden

404 Not Found

500 Internal Server Error

Notes

  • Semantic search uses vector similarity to find relevant documents
  • Results are sorted by relevance score (highest first)
  • Use min_score to filter out low-relevance results
  • Content previews are truncated to 500 characters
  • The top_k parameter limits the number of results returned
  • Metadata includes information about the document source and location

Autorizações

Authorization
string
header
obrigatório

API key authentication using Bearer token format. Example: Authorization: Bearer sk-your-api-key-here

Parâmetros de caminho

indexName
string
obrigatório

Name of the index to search

Exemplo:

"my-knowledge-base"

Parâmetros de consulta

query
string
obrigatório

Search query text

Exemplo:

"What is machine learning?"

top_k
integer
padrão:10

Maximum number of results to return (1-50, default: 10)

Intervalo necessário: 1 <= x <= 50
Exemplo:

10

min_score
number<float>
padrão:0

Minimum relevance score threshold (0.0-1.0, default: 0.0)

Intervalo necessário: 0 <= x <= 1
Exemplo:

0.5

Resposta

Search completed successfully

success
boolean
Exemplo:

true

request_id
string<uuid>
Exemplo:

"550e8400-e29b-41d4-a716-446655440000"

query
string
Exemplo:

"What is machine learning?"

results
object
index
object