Pular para o conteúdo principal
POST
/
api
/
v1
/
search
/
tables
/
{table_name}
/
indices
Python (SDK)
from openapi import SDK, models


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.search.tables.create_indices(table_name="<value>", indices=[
        models.IndexRequest(
            field="embedding",
            config=models.IvfFlatIndexConfig(
                distance_type="cosine",
                num_partitions=128,
                max_iterations=50,
                sample_rate=256,
                reindex_after=3600,
            ),
        ),
    ])

    # Handle response
    print(res)
{
  "indices_created": [
    {
      "config": {
        "distance_type": "cosine",
        "num_partitions": 128,
        "type": "IVF_FLAT"
      },
      "field": "embedding",
      "index_type": "IVF_FLAT"
    }
  ],
  "message": "Successfully created 1 indices"
}

Autorizações

Authorization
string
header
obrigatório

Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.

Parâmetros de caminho

table_name
string
obrigatório

Corpo

application/json
indices
IndexRequest · object[]
obrigatório

Resposta

Resposta Bem-Sucedida

message
string
obrigatório
indices_created
IndexInfo · object[]
obrigatório