weaviate-client
    Preparing search index...

    Interface Collections

    interface Collections {
        create<
            TProperties extends Properties
            | undefined = undefined,
            TName = string,
            TVectors extends Vectors | undefined = undefined,
        >(
            config: CollectionConfigCreate<TProperties, TName, TVectors>,
        ): Promise<Collection<TProperties, TName, TVectors>>;
        createFromSchema(
            config: {
                class?: string;
                description?: string;
                invertedIndexConfig?: {
                    bm25?: { b?: number; k1?: number };
                    cleanupIntervalSeconds?: number;
                    indexNullState?: boolean;
                    indexPropertyLength?: boolean;
                    indexTimestamps?: boolean;
                    stopwords?: {
                        additions?: string[];
                        preset?: string;
                        removals?: string[];
                    };
                    tokenizerUserDict?: {
                        replacements?: { source: string; target: string }[];
                        tokenizer?: string;
                    }[];
                    usingBlockMaxWAND?: boolean;
                };
                moduleConfig?: { [key: string]: unknown };
                multiTenancyConfig?: {
                    autoTenantActivation?: boolean;
                    autoTenantCreation?: boolean;
                    enabled?: boolean;
                };
                objectTtlConfig?: {
                    defaultTtl?: number;
                    deleteOn?: string;
                    enabled?: boolean;
                    filterExpiredObjects?: boolean;
                };
                properties?: {
                    dataType?: string[];
                    description?: string;
                    indexFilterable?: boolean;
                    indexInverted?: boolean;
                    indexRangeFilters?: boolean;
                    indexSearchable?: boolean;
                    moduleConfig?: { [key: string]: unknown };
                    name?: string;
                    nestedProperties?: {
                        dataType?: string[];
                        description?: string;
                        indexFilterable?: boolean;
                        indexRangeFilters?: boolean;
                        indexSearchable?: boolean;
                        name?: string;
                        nestedProperties?: { dataType?: string[] | undefined; description?: string | undefined; name?: string | undefined; indexFilterable?: boolean | undefined; indexSearchable?: boolean | undefined; indexRangeFilters?: boolean | undefined; tokenization?: "word" | ... 8 more ... | undefined; nestedProperties?: ...[] | undefined; }[] | undefi...;
                        tokenization?:
                            | "word"
                            | "lowercase"
                            | "whitespace"
                            | "field"
                            | "trigram"
                            | "gse"
                            | "kagome_kr"
                            | "kagome_ja"
                            | "gse_ch";
                    }[];
                    tokenization?: | "word"
                    | "lowercase"
                    | "whitespace"
                    | "field"
                    | "trigram"
                    | "gse"
                    | "kagome_kr"
                    | "kagome_ja"
                    | "gse_ch";
                }[];
                replicationConfig?: {
                    asyncEnabled?: boolean;
                    deletionStrategy?: | "NoAutomatedResolution"
                    | "DeleteOnConflict"
                    | "TimeBasedResolution";
                    factor?: number;
                };
                shardingConfig?: { [key: string]: unknown };
                vectorConfig?: {
                    [key: string]: {
                        vectorIndexConfig?: { [key: string]: unknown };
                        vectorIndexType?: string;
                        vectorizer?: { [key: string]: unknown };
                    };
                };
                vectorIndexConfig?: { [key: string]: unknown };
                vectorIndexType?: string;
                vectorizer?: string;
            },
        ): Promise<Collection<Properties, string, undefined>>;
        delete(collection: string): Promise<void>;
        deleteAll(): Promise<void[]>;
        exists(name: string): Promise<boolean>;
        export(name: string): Promise<CollectionConfig>;
        get<
            TProperties extends Properties
            | undefined = undefined,
            TName extends string = string,
        >(
            name: TName,
        ): Collection<TProperties, TName>;
        listAll(): Promise<CollectionConfig[]>;
        use<
            TName extends string = string,
            TProperties extends Properties | undefined = undefined,
            TVectors extends Vectors | undefined = undefined,
        >(
            name: TName,
        ): Collection<TProperties, TName, TVectors>;
    }
    Index

    Methods

    • Parameters

      • config: {
            class?: string;
            description?: string;
            invertedIndexConfig?: {
                bm25?: { b?: number; k1?: number };
                cleanupIntervalSeconds?: number;
                indexNullState?: boolean;
                indexPropertyLength?: boolean;
                indexTimestamps?: boolean;
                stopwords?: { additions?: string[]; preset?: string; removals?: string[] };
                tokenizerUserDict?: {
                    replacements?: { source: string; target: string }[];
                    tokenizer?: string;
                }[];
                usingBlockMaxWAND?: boolean;
            };
            moduleConfig?: { [key: string]: unknown };
            multiTenancyConfig?: {
                autoTenantActivation?: boolean;
                autoTenantCreation?: boolean;
                enabled?: boolean;
            };
            objectTtlConfig?: {
                defaultTtl?: number;
                deleteOn?: string;
                enabled?: boolean;
                filterExpiredObjects?: boolean;
            };
            properties?: {
                dataType?: string[];
                description?: string;
                indexFilterable?: boolean;
                indexInverted?: boolean;
                indexRangeFilters?: boolean;
                indexSearchable?: boolean;
                moduleConfig?: { [key: string]: unknown };
                name?: string;
                nestedProperties?: {
                    dataType?: string[];
                    description?: string;
                    indexFilterable?: boolean;
                    indexRangeFilters?: boolean;
                    indexSearchable?: boolean;
                    name?: string;
                    nestedProperties?: { dataType?: string[] | undefined; description?: string | undefined; name?: string | undefined; indexFilterable?: boolean | undefined; indexSearchable?: boolean | undefined; indexRangeFilters?: boolean | undefined; tokenization?: "word" | ... 8 more ... | undefined; nestedProperties?: ...[] | undefined; }[] | undefi...;
                    tokenization?:
                        | "word"
                        | "lowercase"
                        | "whitespace"
                        | "field"
                        | "trigram"
                        | "gse"
                        | "kagome_kr"
                        | "kagome_ja"
                        | "gse_ch";
                }[];
                tokenization?: | "word"
                | "lowercase"
                | "whitespace"
                | "field"
                | "trigram"
                | "gse"
                | "kagome_kr"
                | "kagome_ja"
                | "gse_ch";
            }[];
            replicationConfig?: {
                asyncEnabled?: boolean;
                deletionStrategy?: | "NoAutomatedResolution"
                | "DeleteOnConflict"
                | "TimeBasedResolution";
                factor?: number;
            };
            shardingConfig?: { [key: string]: unknown };
            vectorConfig?: {
                [key: string]: {
                    vectorIndexConfig?: { [key: string]: unknown };
                    vectorIndexType?: string;
                    vectorizer?: { [key: string]: unknown };
                };
            };
            vectorIndexConfig?: { [key: string]: unknown };
            vectorIndexType?: string;
            vectorizer?: string;
        }
        • Optionalclass?: string

          Name of the collection (formerly 'class') (required). Multiple words should be concatenated in CamelCase, e.g. ArticleAuthor.

        • Optionaldescription?: string

          Description of the collection for metadata purposes.

        • OptionalinvertedIndexConfig?: {
              bm25?: { b?: number; k1?: number };
              cleanupIntervalSeconds?: number;
              indexNullState?: boolean;
              indexPropertyLength?: boolean;
              indexTimestamps?: boolean;
              stopwords?: { additions?: string[]; preset?: string; removals?: string[] };
              tokenizerUserDict?: {
                  replacements?: { source: string; target: string }[];
                  tokenizer?: string;
              }[];
              usingBlockMaxWAND?: boolean;
          }
          • Optionalbm25?: { b?: number; k1?: number }
            • Optionalb?: number

              Format: float

              Calibrates term-weight scaling based on the document length (default: 0.75).

            • Optionalk1?: number

              Format: float

              Calibrates term-weight scaling based on the term frequency within a document (default: 1.2).

          • OptionalcleanupIntervalSeconds?: number

            Format: int

            Asynchronous index clean up happens every n seconds (default: 60).

          • OptionalindexNullState?: boolean

            Index each object with the null state (default: false).

          • OptionalindexPropertyLength?: boolean

            Index length of properties (default: false).

          • OptionalindexTimestamps?: boolean

            Index each object by its internal timestamps (default: false).

          • Optionalstopwords?: { additions?: string[]; preset?: string; removals?: string[] }
            • Optionaladditions?: string[]

              Stopwords to be considered additionally (default: []). Can be any array of custom strings.

            • Optionalpreset?: string

              Pre-existing list of common words by language (default: en). Options: [en, none].

            • Optionalremovals?: string[]

              Stopwords to be removed from consideration (default: []). Can be any array of custom strings.

          • OptionaltokenizerUserDict?: { replacements?: { source: string; target: string }[]; tokenizer?: string }[]

            User-defined dictionary for tokenization.

          • OptionalusingBlockMaxWAND?: boolean

            Using BlockMax WAND for query execution (default: false, will be true for new collections created after 1.30).

        • OptionalmoduleConfig?: { [key: string]: unknown }

          Configuration specific to modules in a collection context.

        • OptionalmultiTenancyConfig?: {
              autoTenantActivation?: boolean;
              autoTenantCreation?: boolean;
              enabled?: boolean;
          }
          • OptionalautoTenantActivation?: boolean

            Existing tenants should (not) be turned HOT implicitly when they are accessed and in another activity status (default: false).

          • OptionalautoTenantCreation?: boolean

            Nonexistent tenants should (not) be created implicitly (default: false).

          • Optionalenabled?: boolean

            Whether or not multi-tenancy is enabled for this collection (class) (default: false).

        • OptionalobjectTtlConfig?: {
              defaultTtl?: number;
              deleteOn?: string;
              enabled?: boolean;
              filterExpiredObjects?: boolean;
          }
          • OptionaldefaultTtl?: number

            Interval (in seconds) to be added to deleteOn value, denoting object's expiration time. Has to be positive for deleteOn set to _creationTimeUnix or _lastUpdateTimeUnix, any for custom property (default: 0).

          • OptionaldeleteOn?: string

            Name of the property holding base time to compute object's expiration time (ttl = value of deleteOn property + defaultTtl). Can be set to _creationTimeUnix, _lastUpdateTimeUnix or custom property of date datatype.

          • Optionalenabled?: boolean

            Whether or not object ttl is enabled for this collection (default: false).

          • OptionalfilterExpiredObjects?: boolean

            Whether remove from resultset expired, but not yet deleted by background process objects (default: false).

        • Optionalproperties?: {
              dataType?: string[];
              description?: string;
              indexFilterable?: boolean;
              indexInverted?: boolean;
              indexRangeFilters?: boolean;
              indexSearchable?: boolean;
              moduleConfig?: { [key: string]: unknown };
              name?: string;
              nestedProperties?: {
                  dataType?: string[];
                  description?: string;
                  indexFilterable?: boolean;
                  indexRangeFilters?: boolean;
                  indexSearchable?: boolean;
                  name?: string;
                  nestedProperties?: { dataType?: string[] | undefined; description?: string | undefined; name?: string | undefined; indexFilterable?: boolean | undefined; indexSearchable?: boolean | undefined; indexRangeFilters?: boolean | undefined; tokenization?: "word" | ... 8 more ... | undefined; nestedProperties?: ...[] | undefined; }[] | undefi...;
                  tokenization?:
                      | "word"
                      | "lowercase"
                      | "whitespace"
                      | "field"
                      | "trigram"
                      | "gse"
                      | "kagome_kr"
                      | "kagome_ja"
                      | "gse_ch";
              }[];
              tokenization?: | "word"
              | "lowercase"
              | "whitespace"
              | "field"
              | "trigram"
              | "gse"
              | "kagome_kr"
              | "kagome_ja"
              | "gse_ch";
          }[]

          Define properties of the collection.

        • OptionalreplicationConfig?: {
              asyncEnabled?: boolean;
              deletionStrategy?:
                  | "NoAutomatedResolution"
                  | "DeleteOnConflict"
                  | "TimeBasedResolution";
              factor?: number;
          }
          • OptionalasyncEnabled?: boolean

            Enable asynchronous replication (default: false).

          • OptionaldeletionStrategy?: "NoAutomatedResolution" | "DeleteOnConflict" | "TimeBasedResolution"

            Conflict resolution strategy for deleted objects.

          • Optionalfactor?: number

            Number of times a collection (class) is replicated (default: 1).

        • OptionalshardingConfig?: { [key: string]: unknown }

          Manage how the index should be sharded and distributed in the cluster

        • OptionalvectorConfig?: {
              [key: string]: {
                  vectorIndexConfig?: { [key: string]: unknown };
                  vectorIndexType?: string;
                  vectorizer?: { [key: string]: unknown };
              };
          }

          Configure named vectors. Either use this field or vectorizer, vectorIndexType, and vectorIndexConfig fields. Available from v1.24.0.

        • OptionalvectorIndexConfig?: { [key: string]: unknown }

          Vector-index config, that is specific to the type of index selected in vectorIndexType

        • OptionalvectorIndexType?: string

          Name of the vector index type to use for the collection (e.g. hnsw or flat).

        • Optionalvectorizer?: string

          Specify how the vectors for this collection should be determined. The options are either none - this means you have to import a vector with each object yourself - or the name of a module that provides vectorization capabilities, such as text2vec-weaviate. If left empty, it will use the globally configured default (DEFAULT_VECTORIZER_MODULE) which can itself either be none or a specific module.

      Returns Promise<Collection<Properties, string, undefined>>

    • Parameters

      • collection: string

      Returns Promise<void>