Type alias EnsureVectorIndexOptions

EnsureVectorIndexOptions: EnsureIndexOptionsType<"vector", [string], {
    parallelism?: number;
    params: {
        defaultNProbe?: number;
        dimension: number;
        factory?: string;
        metric: "cosine" | "l2" | "innerProduct";
        nLists?: VectorIndexNLists;
        numberOfDocsPerCentroid?: number;
        trainingIterations?: number;
    };
    sparse?: boolean;
    storedValues?: string[];
}>

Options for creating a vector index.

Type declaration

  • Optional parallelism?: number

    The number of threads to use for indexing. Default is 2.

  • params: {
        defaultNProbe?: number;
        dimension: number;
        factory?: string;
        metric: "cosine" | "l2" | "innerProduct";
        nLists?: VectorIndexNLists;
        numberOfDocsPerCentroid?: number;
        trainingIterations?: number;
    }

    Vector index parameters, following Faiss configuration.

    • Optional defaultNProbe?: number

      How many neighboring centroids to probe by default. Higher = slower, better recall.

    • dimension: number

      Vector dimension. Must match the length of vectors in documents.

    • Optional factory?: string

      Advanced Faiss index factory string. If not specified, defaults to IVF<nLists>,Flat.

      From ArangoDB 3.12.10 onward, the centroid count can be represented by a {} placeholder, which the server replaces with the resolved nLists value for each shard.

    • metric: "cosine" | "l2" | "innerProduct"

      Whether to use cosine, l2 (Euclidean), or innerProduct distance. innerProduct was introduced in ArangoDB 3.12.6.

    • Optional nLists?: VectorIndexNLists

      Number of Voronoi cells (centroids) for IVF, or options for computing the number from the document count at training time.

      Up to ArangoDB 3.12.9, this is required and must be a number. From ArangoDB 3.12.10 onward, it can be an object and can be omitted to use the server's default scaling options.

    • Optional numberOfDocsPerCentroid?: number

      Maximum number of vectors per centroid to include in the training sample.

      Default: 100

      Introduced in: ArangoDB 3.12.10

    • Optional trainingIterations?: number

      Training iterations for index build. Default is 25.

  • Optional sparse?: boolean

    Whether to create a sparse index that excludes documents with the attribute for indexing missing or set to null.

    Default: false

  • Optional storedValues?: string[]

    An array of attribute paths that will be stored in the index for efficient filtering. From ArangoDB 3.12.10 onward, these can also cover projections so the attributes can be returned without materializing the documents.

    The maximum number of attributes that you can use in storedValues is 32.

    Introduced in: ArangoDB 3.12.7