Retrieve documents from an index

Retrieve documents from an index using a query, top_k, and other parameters

Body Params
string
required

The name of the index to retrieve documents from

string
required

The search query used for retrieving documents

integer
required
1 to 2048

The number of documents to retrieve

number
0 to 1

Between 0 and 1, configures balance between keyword and semantic retrieval

boolean

Whether to rerank the results after retrieval

metadata_filter
object

The filter object is used to specify query criteria for filtering results. Each key in the filter object represents a field name, and its value is a dictionary of comparison operators. Logical operators can be used within these dictionaries to combine multiple conditions.

  • Comparison Operators:

    • $eq: Checks if a field is equal to a specified value (string, number, or boolean).
      • Simplified form: "field1": "value1" is equivalent to "field1": {"$eq": "value1"}.
    • $ne: Checks if a field is not equal to a specified value (string, number, or boolean).
    • $gt: Checks if a field is greater than a specified numeric value.
    • $gte: Checks if a field is greater than or equal to a specified numeric value.
    • $lt: Checks if a field is less than a specified numeric value.
    • $lte: Checks if a field is less than or equal to a specified numeric value.
    • $in: Checks if a field's value is within a specified list of values (strings, numbers).
    • $nin: Checks if a field's value is not within a specified list of values (strings, numbers).
  • Logical Operators (used within field-specific dictionaries):

    • $and: An array of filter objects, all of which must evaluate to true.
    • $or: An array of filter objects, at least one of which must evaluate to true.

Example:

{
  "field1": "value1",  // Simplified equals check
  "field2": {"$gt": 10},
  "field3": {
    "$or": [
      {"$in": ["value2", "value3"]},
      {"$ne": "value4"}
    ]
  }
}
Responses

Language
Credentials
Header
Request
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json