v7

latestOpenAPI 3.1.0Apache-2.0raw.githubusercontent.com2026-08-041951192.5 KB
Query

Query Index

Query results from index with index_id The following parameters are supported:

  • Result type
  • Result sorting
  • Realtime search
  • Field filter
  • Fields to include in search results
  • Distance fields: derived fields from distance calculations
  • Highlights: keyword-in-context snippets and term highlighting
  • Query facets: which facets fields to calculate and return at query time
  • Facet filter: filter facets by field and value
  • Result sort: sort results by field and direction
  • Query type default: default query type, if not specified in query
post/api/v1/index/{index_id}/query

Path parameters

index_idinteger required

index id

Headers

apikeystring required

YOUR_SECRET_API_KEY

Request body

querystring required

Query string, search operators + - "" are recognized.

{"stackTrail":"components:schemas:SearchRequestObject:properties:query_vector","oasType":"schema","type":"unknown","description":"Optional query vector: If None, then the query vector is derived from the query string using the specified model. If Some, then the query vector is used for semantic search and the query string is only used for lexical search and highlighting."}
enable_empty_queryboolean

Enable empty query: if true, an empty query string iterates through all indexed documents, supporting the query parameters: offset, length, query_facets, facet_filter, result_sort, otherwise an empty query string returns no results. Typical use cases include index browsing, index export, conversion, analytics, audits, and inspection.

offsetinteger

Offset of search results to return.

lengthinteger

Number of search results to return.

result_type'Count' | 'Topk' | 'TopkCount'

The following result types are supported:

  • Count (count all results that match the query, but returning top-k results is not required)
  • Topk (returns the top-k results per query, but counting all results that match the query is not required)
  • TopkCount (returns the top-k results per query + count all results that match the query)
realtimeboolean

True realtime search: include indexed, but uncommitted documents into search results.

field_filterstring[]

Specify field names where to search at querytime, whereas SchemaField.indexed is set at indextime. If empty then all indexed fields are searched.

fieldsstring[]

Specify names of fields to return in the search results, where SchemaField.store is set at indextime. If empty then all stored fields are returned.

query_type_default'Union' | 'Intersection' | 'Phrase' | 'Not'

Specifies the default QueryType: The following query types are supported:

  • Union (OR, disjunction),
  • Intersection (AND, conjunction),
  • Phrase (""),
  • Not (-).

The default QueryType is superseded if the query parser detects that a different query type is specified within the query string (+ - "").

Example request

{
  "length": 10,
  "field_filter": [
    "title"
  ],
  "result_sort": [
    {
      "field": "date",
      "order": "Ascending",
      "base": "None"
    }
  ]
}

Response

Results found, returns the SearchResultObject

timeinteger required

Time taken to execute the search query in nanoseconds

original_querystring required

Search query string

querystring required

Search query string after any automatic query correction or completion

offsetinteger required

Offset of the returned search results

lengthinteger required

Number of requested search results

countinteger required

Number of returned search results matching the query

count_totalinteger required

Total number of search results matching the query

query_termsstring[] required

Vector of search query terms. Can be used e.g. for custom highlighting.

resultsobject[] required

Vector of search result documents

facetsobject required

Facets with their values and corresponding document counts

suggestionsstring[] required

Suggestions for query correction or completion