Skip to main content

CreateIndexRequest

The CreateIndexRequest interface defines the parameters for creating a new encrypted index.

Properties

Example Usage


IndexOperationRequest

Base interface for operations that require index identification and authentication.

Properties

Example Usage


UpsertRequest

Interface for adding or updating vectors in an encrypted index.

Properties

Example Usage


QueryRequest

Interface for performing similarity search in the encrypted index.

Properties

Example Usage


BatchQueryRequest

Interface for performing batch similarity searches with multiple vectors.

Properties

Example Usage


TrainRequest

Interface for training an index to optimize query performance.

Properties

Example Usage


DeleteRequest

Interface for deleting vectors from the encrypted index.

Properties

Example Usage


GetRequest

Interface for retrieving specific vectors from the index.

Properties

Example Usage


VectorItem

Interface representing a vectorized item for storage in the encrypted index.

Properties

Example Usage


IndexConfig

Base type for index configuration. Use one of the specific index types:

IndexIVF

Standard IVF (Inverted File) index configuration, ideal for balanced performance:

Properties

Example Usage

IndexIVFFlat

IVFFlat index configuration, suitable for highest accuracy requirements:

Properties

Example Usage

IndexIVFPQ

IVFPQ (Product Quantization) index configuration, optimized for memory efficiency:

Properties

Example Usage


Response Types

GetResponseModel

Response interface for vector retrieval operations.

Properties

QueryResponse

Response interface for similarity search operations with helper methods.

Properties

Helper Methods

  • isBatchResponse(): boolean: Determines if response contains batch results
  • getFirstResultSet(): QueryResultItem[]: Returns first result set from response

Example Usage

QueryResultItem

Interface representing a single result from similarity search.

Properties


Error Types

ErrorResponseModel

Standard error response interface for API errors.

Properties

HTTPValidationError

Interface for validation errors with detailed field information.

Properties


Metadata Filtering

The filters parameter in query operations supports a subset of MongoDB query operators for flexible metadata filtering:

Supported Operators

  • $eq: Equality ({ "category": "research" })
  • $ne: Not equal ({ "status": { "$ne": "draft" } })
  • $gt: Greater than ({ "score": { "$gt": 0.8 } })
  • $gte: Greater than or equal ({ "year": { "$gte": 2020 } })
  • $lt: Less than ({ "price": { "$lt": 100 } })
  • $lte: Less than or equal ({ "rating": { "$lte": 4.5 } })
  • $in: In array ({ "tag": { "$in": ["ai", "ml"] } })
  • $nin: Not in array ({ "category": { "$nin": ["spam", "deleted"] } })
  • $and: Logical AND ({ "$and": [{"a": 1}, {"b": 2}] })
  • $or: Logical OR ({ "$or": [{"x": 1}, {"y": 2}] })

Filter Examples

For more information on metadata filtering, see Metadata Filtering.

Field Selection

Many operations support field selection through the include parameter:

Available Fields

  • vector: The vector data itself
  • contents: Text or binary content associated with the vector
  • metadata: Structured metadata object
  • distance: Similarity distance (query operations only)

Example Usage

Selecting only necessary fields improves performance by reducing data transfer and processing overhead.