Simple Single Corpus Query
GET/v2/corpora/:corpus_key/query
Search a single corpus with a straightforward query request, specifying the corpus key and query parameters.
- Specify the unique
corpus_key
identifying the corpus to query. - Enter the search
query
string for the corpus, which is the question you want to ask. - Set the maximum number of results (
limit
) to return. Default: 10, minimum: 1 - Define the
offset
position from which to start in the result set.
For more detailed information, see this Query API guide.
Request
Path Parameters
Possible values: <= 50 characters
, Value must match regular expression [a-zA-Z0-9_\=\-]+$
The unique key identifying the corpus to query.
Query Parameters
The search query string for the corpus, which is the question the user is asking.
Possible values: >= 1
Default value: 10
Maximum number of results to return.
Position from which to start in the result set.
Responses
- 200
- 400
- 403
- 404
A response to a query.
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
The summary of the search results.
Possible values: [auto
, eng
, deu
, fra
, zho
, kor
, ara
, rus
, tha
, nld
, ita
, por
, spa
, jpn
, pol
, tur
, vie
, ind
, ces
, ukr
, ell
, heb
, fas
, hin
, urd
, swe
, ben
, msa
, ron
]
Default value: auto
Languages that the Vectara platform supports.
search_results object[]
The ranked search results.
The document part altered by the context configuration that matches the query.
The score of the individual result.
part_metadata object
The metadata for the document part.
The metadata for the document part.
document_metadata object
The metadata for the document that contains the document part.
The metadata for the document that contains the document part.
The ID of the document that contains the document part.
A query request can search over multiple corpora at a time. This property is set to the index in the list of corpora in the original search request that this search result originated from.
If the query request is only over one corpus, this property is 0.
The probability that the summary is factually consistent with the results.
The rendered prompt sent to the LLM. Useful when creating customer prompt_text
templates. Only available
to Scale customers.
{
"summary": "string",
"response_language": "auto",
"search_results": [
{
"text": "string",
"score": 0,
"part_metadata": {},
"document_metadata": {},
"document_id": "string",
"request_corpora_index": 0
}
],
"factual_consistency_score": 0,
"rendered_prompt": "string"
}
Query request was malformed.
- application/json
- Schema
- Example (from schema)
Schema
field_errors object
The errors that relate to specific fields in the request.
The ID of the request that can be used to help Vectara support debug what went wrong.
{
"field_errors": {},
"messages": [
"string"
],
"request_id": "string"
}
Permissions do not allow querying the corpus.
- application/json
- Schema
- Example (from schema)
Schema
The messages describing why the error occurred.
The ID of the request that can be used to help Vectara support debug what went wrong .
{
"messages": [
"Internal server error."
],
"request_id": "string"
}
Corpus not found.
- application/json
- Schema
- Example (from schema)
Schema
The ID cannot found.
ID of the request that can be used to help Vectara support debug what went wrong.
{
"id": "string",
"messages": [
"string"
],
"request_id": "string"
}