CreateIndexRequest
interface defines the parameters for creating a new encrypted index.
Parameter | Type | Required | Description |
---|---|---|---|
indexConfig | IndexConfig | Yes | Configuration model specifying index type and parameters |
indexKey | string | Yes | 32-byte encryption key as hex string |
indexName | string | Yes | Unique name/identifier for the index |
embeddingModel | string | null | No | Optional embedding model name for automatic vector generation |
Parameter | Type | Required | Description |
---|---|---|---|
indexKey | string | Yes | 32-byte encryption key as hex string |
indexName | string | Yes | Name/identifier of the target index |
Parameter | Type | Required | Description |
---|---|---|---|
indexKey | string | Yes | 32-byte encryption key as hex string |
indexName | string | Yes | Name/identifier of the target index |
items | VectorItem[] | Yes | Array of vector items to insert or update |
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
indexKey | string | Yes | - | 32-byte encryption key as hex string |
indexName | string | Yes | - | Name/identifier of the target index |
queryVector | number[] | number[][] | null | No | - | Vector(s) for similarity search |
queryContents | string | null | No | - | Text content for semantic search (requires embedding model) |
topK | number | No | 100 | Number of nearest neighbors to return |
nProbes | number | No | 1 | Number of lists to probe during query |
greedy | boolean | No | false | Whether to use greedy search algorithm |
filters | object | null | No | - | JSON-like dictionary for metadata filtering |
include | string[] | No | ["distances"] | Fields to include in response |
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
indexKey | string | Yes | - | 32-byte encryption key as hex string |
indexName | string | Yes | - | Name/identifier of the target index |
queryVectors | number[][] | Yes | - | Array of vectors for batch similarity search |
topK | number | No | 100 | Number of nearest neighbors to return per query |
nProbes | number | No | 1 | Number of lists to probe during each query |
greedy | boolean | No | false | Whether to use greedy search algorithm |
filters | object | No | - | JSON-like dictionary for metadata filtering |
include | string[] | No | ["distances"] | Fields to include in response |
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
indexKey | string | Yes | - | 32-byte encryption key as hex string |
indexName | string | Yes | - | Name/identifier of the target index |
batchSize | number | No | 2048 | Size of each batch for training |
maxIters | number | No | 100 | Maximum iterations for training |
tolerance | number | No | 1e-6 | Convergence tolerance for training |
maxMemory | number | No | 0 | Maximum memory usage in MB (0 = no limit) |
Parameter | Type | Required | Description |
---|---|---|---|
indexKey | string | Yes | 32-byte encryption key as hex string |
indexName | string | Yes | Name/identifier of the target index |
ids | string[] | Yes | Array of vector IDs to delete |
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
indexKey | string | Yes | - | 32-byte encryption key as hex string |
indexName | string | Yes | - | Name/identifier of the target index |
ids | string[] | Yes | - | Array of vector IDs to retrieve |
include | string[] | No | ["vector", "contents", "metadata"] | Fields to include in response |
Parameter | Type | Required | Description |
---|---|---|---|
id | string | Yes | Unique identifier for the vector item |
vector | number[] | null | No | Vector representation of the item |
contents | string | null | No | Original text or associated content |
metadata | object | null | No | Additional structured metadata |
Speed | Accuracy | Memory Usage |
---|---|---|
Fast | Good | Medium |
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
dimension | number | null | No | - | Dimensionality of vector embeddings |
nLists | number | Yes | - | Number of inverted lists |
metric | string | null | No | - | Distance metric ('cosine' , 'euclidean' , etc.) |
type | string | No | 'ivf' | Index type identifier |
Speed | Accuracy | Memory Usage |
---|---|---|
Medium | Highest | High |
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
dimension | number | null | No | - | Dimensionality of vector embeddings |
nLists | number | Yes | - | Number of inverted lists |
metric | string | null | No | - | Distance metric |
type | string | No | 'ivfflat' | Index type identifier |
Speed | Accuracy | Memory Usage |
---|---|---|
Fast | Good | Low |
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
dimension | number | null | No | - | Dimensionality of vector embeddings |
nLists | number | Yes | - | Number of inverted lists |
metric | string | null | No | - | Distance metric |
type | string | No | 'ivfpq' | Index type identifier |
pqDim | number | Yes | - | Dimensionality after quantization |
pqBits | number | Yes | - | Number of bits per quantizer (1-16) |
Parameter | Type | Description |
---|---|---|
results | GetResultItemModel[] | Array of retrieved items with requested fields |
Parameter | Type | Description |
---|---|---|
results | QueryResultItem[] | QueryResultItem[][] | Search results (flat for single queries, nested for batch) |
isBatchResponse(): boolean
: Determines if response contains batch resultsgetFirstResultSet(): QueryResultItem[]
: Returns first result set from responseParameter | Type | Description |
---|---|---|
id | string | Identifier of the retrieved item |
distance | number | null | Distance from query vector (lower = more similar) |
metadata | object | null | Additional metadata for the result |
vector | number[] | null | Retrieved vector (if included in response) |
Parameter | Type | Description |
---|---|---|
statusCode | number | HTTP status code of the error |
detail | string | Detailed message describing the error |
Parameter | Type | Description |
---|---|---|
detail | ValidationError[] | Array of validation errors with field details |
filters
parameter in query operations supports a subset of MongoDB query operators for flexible metadata filtering:
$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}] }
)include
parameter:
vector
: The vector data itselfcontents
: Text or binary content associated with the vectormetadata
: Structured metadata objectdistance
: Similarity distance (query operations only)