weaviate-client
    Preparing search index...

    Interface Query<T, V>

    All the available methods on the .query namespace.

    interface Query<T, V> {
        fetchObjectById: <I extends IncludeVector<V>>(
            id: string,
            opts?: FetchObjectByIdOptions<T, I>,
        ) => Promise<WeaviateObject<T, ReturnVectors<V, I>> | null>;
        fetchObjects: <I extends IncludeVector<V>>(
            opts?: FetchObjectsOptions<T, I>,
        ) => Promise<WeaviateReturn<T, ReturnVectors<V, I>>>;
        bm25<I extends IncludeVector<V>, RV>(
            query: string,
            opts?: BaseBm25Options<T, I>,
        ): Promise<WeaviateReturn<T, RV>>;
        bm25<I extends IncludeVector<V>, RV>(
            query: string,
            opts: GroupByBm25Options<T, I>,
        ): Promise<GroupByReturn<T, RV>>;
        bm25<I extends IncludeVector<V>, RV>(
            query: string,
            opts?: Bm25Options<T, I>,
        ): QueryReturn<T, RV>;
        hybrid<I extends IncludeVector<V>, RV>(
            query: string,
            opts?: BaseHybridOptions<T, V, I>,
        ): Promise<WeaviateReturn<T, RV>>;
        hybrid<I extends IncludeVector<V>, RV>(
            query: string,
            opts: GroupByHybridOptions<T, V, I>,
        ): Promise<GroupByReturn<T, RV>>;
        hybrid<I extends IncludeVector<V>, RV>(
            query: string,
            opts?: HybridOptions<T, V, I>,
        ): QueryReturn<T, RV>;
        nearImage<I extends IncludeVector<V>, RV>(
            image: string | Buffer<ArrayBufferLike>,
            opts?: BaseNearOptions<T, V, I>,
        ): Promise<WeaviateReturn<T, RV>>;
        nearImage<I extends IncludeVector<V>, RV>(
            image: string | Buffer<ArrayBufferLike>,
            opts: GroupByNearOptions<T, V, I>,
        ): Promise<GroupByReturn<T, RV>>;
        nearImage<I extends IncludeVector<V>, RV>(
            image: string | Buffer<ArrayBufferLike>,
            opts?: NearOptions<T, V, I>,
        ): QueryReturn<T, RV>;
        nearMedia<I extends IncludeVector<V>, RV>(
            media: string | Buffer<ArrayBufferLike>,
            type: NearMediaType,
            opts?: BaseNearOptions<T, V, I>,
        ): Promise<WeaviateReturn<T, RV>>;
        nearMedia<I extends IncludeVector<V>, RV>(
            media: string | Buffer<ArrayBufferLike>,
            type: NearMediaType,
            opts: GroupByNearOptions<T, V, I>,
        ): Promise<GroupByReturn<T, RV>>;
        nearMedia<I extends IncludeVector<V>, RV>(
            media: string | Buffer<ArrayBufferLike>,
            type: NearMediaType,
            opts?: NearOptions<T, V, I>,
        ): QueryReturn<T, RV>;
        nearObject<I extends IncludeVector<V>, RV>(
            id: string,
            opts?: BaseNearOptions<T, V, I>,
        ): Promise<WeaviateReturn<T, RV>>;
        nearObject<I extends IncludeVector<V>, RV>(
            id: string,
            opts: GroupByNearOptions<T, V, I>,
        ): Promise<GroupByReturn<T, RV>>;
        nearObject<I extends IncludeVector<V>, RV>(
            id: string,
            opts?: NearOptions<T, V, I>,
        ): QueryReturn<T, RV>;
        nearText<I extends IncludeVector<V>, RV>(
            query: string | string[],
            opts?: BaseNearTextOptions<T, V, I>,
        ): Promise<WeaviateReturn<T, RV>>;
        nearText<I extends IncludeVector<V>, RV>(
            query: string | string[],
            opts: GroupByNearTextOptions<T, V, I>,
        ): Promise<GroupByReturn<T, RV>>;
        nearText<I extends IncludeVector<V>, RV>(
            query: string | string[],
            opts?: NearTextOptions<T, V, I>,
        ): QueryReturn<T, RV>;
        nearVector<I extends IncludeVector<V>, RV>(
            vector: NearVectorInputType,
            opts?: BaseNearOptions<T, V, I>,
        ): Promise<WeaviateReturn<T, RV>>;
        nearVector<I extends IncludeVector<V>, RV>(
            vector: NearVectorInputType,
            opts: GroupByNearOptions<T, V, I>,
        ): Promise<GroupByReturn<T, RV>>;
        nearVector<I extends IncludeVector<V>, RV>(
            vector: NearVectorInputType,
            opts?: NearOptions<T, V, I>,
        ): QueryReturn<T, RV>;
    }

    Type Parameters

    • T
    • V

    Hierarchy

    • Bm25<T, V>
    • Hybrid<T, V>
    • NearImage<T, V>
    • NearMedia<T, V>
    • NearObject<T, V>
    • NearText<T, V>
    • NearVector<T, V>
      • Query
    Index

    Properties

    fetchObjectById: <I extends IncludeVector<V>>(
        id: string,
        opts?: FetchObjectByIdOptions<T, I>,
    ) => Promise<WeaviateObject<T, ReturnVectors<V, I>> | null>

    Retrieve an object from the server by its UUID.

    Type Declaration

    fetchObjects: <I extends IncludeVector<V>>(
        opts?: FetchObjectsOptions<T, I>,
    ) => Promise<WeaviateReturn<T, ReturnVectors<V, I>>>

    Retrieve objects from the server without searching.

    Type Declaration

    Methods

    • Search for objects in this collection using the keyword-based BM25 algorithm.

      See the docs for a more detailed explanation.

      This overload is for performing a search without the groupBy param.

      Type Parameters

      • I extends IncludeVector<V>

        The vector(s) to include in the response. If using named vectors, pass an array of strings to include only specific vectors.

      • RV

        The vectors(s) to be returned in the response depending on the input in opts.includeVector.

      Parameters

      • query: string

        The query to search for.

      • Optionalopts: BaseBm25Options<T, I>

        The available options for the search excluding the groupBy param.

      Returns Promise<WeaviateReturn<T, RV>>

      • The result of the search within the fetched collection.
    • Search for objects in this collection using the keyword-based BM25 algorithm.

      See the docs for a more detailed explanation.

      This overload is for performing a search with the groupBy param.

      Type Parameters

      • I extends IncludeVector<V>

        The vector(s) to include in the response. If using named vectors, pass an array of strings to include only specific vectors.

      • RV

        The vectors(s) to be returned in the response depending on the input in opts.includeVector.

      Parameters

      • query: string

        The query to search for.

      • opts: GroupByBm25Options<T, I>

        The available options for the search including the groupBy param.

      Returns Promise<GroupByReturn<T, RV>>

      • The result of the search within the fetched collection.
    • Search for objects in this collection using the keyword-based BM25 algorithm.

      See the docs for a more detailed explanation.

      This overload is for performing a search with a programmatically defined opts param.

      Type Parameters

      • I extends IncludeVector<V>

        The vector(s) to include in the response. If using named vectors, pass an array of strings to include only specific vectors.

      • RV

        The vectors(s) to be returned in the response depending on the input in opts.includeVector.

      Parameters

      • query: string

        The query to search for.

      • Optionalopts: Bm25Options<T, I>

        The available options for the search including the groupBy param.

      Returns QueryReturn<T, RV>

      • The result of the search within the fetched collection.
    • Search for objects in this collection using the hybrid algorithm blending keyword-based BM25 and vector-based similarity.

      See the docs for a more detailed explanation.

      This overload is for performing a search without the groupBy param.

      Type Parameters

      • I extends IncludeVector<V>

        The vector(s) to include in the response. If using named vectors, pass an array of strings to include only specific vectors.

      • RV

        The vectors(s) to be returned in the response depending on the input in opts.includeVector.

      Parameters

      • query: string

        The query to search for in the BM25 keyword search..

      • Optionalopts: BaseHybridOptions<T, V, I>

        The available options for the search excluding the groupBy param.

      Returns Promise<WeaviateReturn<T, RV>>

      • The result of the search within the fetched collection.
    • Search for objects in this collection using the hybrid algorithm blending keyword-based BM25 and vector-based similarity.

      See the docs for a more detailed explanation.

      This overload is for performing a search with the groupBy param.

      Type Parameters

      • I extends IncludeVector<V>

        The vector(s) to include in the response. If using named vectors, pass an array of strings to include only specific vectors.

      • RV

        The vectors(s) to be returned in the response depending on the input in opts.includeVector.

      Parameters

      • query: string

        The query to search for in the BM25 keyword search..

      • opts: GroupByHybridOptions<T, V, I>

        The available options for the search including the groupBy param.

      Returns Promise<GroupByReturn<T, RV>>

      • The result of the search within the fetched collection.
    • Search for objects in this collection using the hybrid algorithm blending keyword-based BM25 and vector-based similarity.

      See the docs for a more detailed explanation.

      This overload is for performing a search with a programmatically defined opts param.

      Type Parameters

      • I extends IncludeVector<V>
      • RV

      Parameters

      • query: string

        The query to search for in the BM25 keyword search..

      • Optionalopts: HybridOptions<T, V, I>

        The available options for the search including the groupBy param.

      Returns QueryReturn<T, RV>

      • The result of the search within the fetched collection.
    • Search for objects by image in this collection using an image-capable vectorization module and vector-based similarity search. You must have an image-capable vectorization module installed in order to use this method, e.g. img2vec-neural, multi2vec-clip, or `multi2vec-bind.

      See the docs for a more detailed explanation.

      This overload is for performing a search without the groupBy param.

      Type Parameters

      • I extends IncludeVector<V>
      • RV

      Parameters

      • image: string | Buffer<ArrayBufferLike>

        The image to search on. This can be a base64 string, a file path string, or a buffer.

      • Optionalopts: BaseNearOptions<T, V, I>

        The available options for the search excluding the groupBy param.

      Returns Promise<WeaviateReturn<T, RV>>

      • The result of the search within the fetched collection.
    • Search for objects by image in this collection using an image-capable vectorization module and vector-based similarity search. You must have an image-capable vectorization module installed in order to use this method, e.g. img2vec-neural, multi2vec-clip, or `multi2vec-bind.

      See the docs for a more detailed explanation.

      This overload is for performing a search with the groupBy param.

      Type Parameters

      • I extends IncludeVector<V>
      • RV

      Parameters

      • image: string | Buffer<ArrayBufferLike>

        The image to search on. This can be a base64 string, a file path string, or a buffer.

      • opts: GroupByNearOptions<T, V, I>

        The available options for the search including the groupBy param.

      Returns Promise<GroupByReturn<T, RV>>

      • The group by result of the search within the fetched collection.
    • Search for objects by image in this collection using an image-capable vectorization module and vector-based similarity search. You must have an image-capable vectorization module installed in order to use this method, e.g. img2vec-neural, multi2vec-clip, or `multi2vec-bind.

      See the docs for a more detailed explanation.

      This overload is for performing a search with a programmatically defined opts param.

      Type Parameters

      • I extends IncludeVector<V>
      • RV

      Parameters

      • image: string | Buffer<ArrayBufferLike>

        The image to search on. This can be a base64 string, a file path string, or a buffer.

      • Optionalopts: NearOptions<T, V, I>

        The available options for the search.

      Returns QueryReturn<T, RV>

      • The result of the search within the fetched collection.
    • Search for objects by image in this collection using an image-capable vectorization module and vector-based similarity search. You must have a multi-media-capable vectorization module installed in order to use this method, e.g. multi2vec-bind or multi2vec-palm.

      See the docs for a more detailed explanation.

      This overload is for performing a search without the groupBy param.

      Type Parameters

      • I extends IncludeVector<V>
      • RV

      Parameters

      • media: string | Buffer<ArrayBufferLike>

        The media to search on. This can be a base64 string, a file path string, or a buffer.

      • type: NearMediaType

        The type of media to search for, e.g. 'audio'.

      • Optionalopts: BaseNearOptions<T, V, I>

        The available options for the search excluding the groupBy param.

      Returns Promise<WeaviateReturn<T, RV>>

      • The result of the search within the fetched collection.
    • Search for objects by image in this collection using an image-capable vectorization module and vector-based similarity search. You must have a multi-media-capable vectorization module installed in order to use this method, e.g. multi2vec-bind or multi2vec-palm.

      See the docs for a more detailed explanation.

      This overload is for performing a search with the groupBy param.

      Type Parameters

      • I extends IncludeVector<V>
      • RV

      Parameters

      • media: string | Buffer<ArrayBufferLike>

        The media to search on. This can be a base64 string, a file path string, or a buffer.

      • type: NearMediaType

        The type of media to search for, e.g. 'audio'.

      • opts: GroupByNearOptions<T, V, I>

        The available options for the search including the groupBy param.

      Returns Promise<GroupByReturn<T, RV>>

      • The group by result of the search within the fetched collection.
    • Search for objects by image in this collection using an image-capable vectorization module and vector-based similarity search. You must have a multi-media-capable vectorization module installed in order to use this method, e.g. multi2vec-bind or multi2vec-palm.

      See the docs for a more detailed explanation.

      This overload is for performing a search with a programmatically defined opts param.

      Type Parameters

      • I extends IncludeVector<V>
      • RV

      Parameters

      • media: string | Buffer<ArrayBufferLike>

        The media to search on. This can be a base64 string, a file path string, or a buffer.

      • type: NearMediaType

        The type of media to search for, e.g. 'audio'.

      • Optionalopts: NearOptions<T, V, I>

        The available options for the search.

      Returns QueryReturn<T, RV>

      • The result of the search within the fetched collection.
    • Search for objects in this collection by another object using a vector-based similarity search.

      See the docs for a more detailed explanation.

      This overload is for performing a search without the groupBy param.

      Type Parameters

      • I extends IncludeVector<V>
      • RV

      Parameters

      • id: string

        The UUID of the object to search for.

      • Optionalopts: BaseNearOptions<T, V, I>

        The available options for the search excluding the groupBy param.

      Returns Promise<WeaviateReturn<T, RV>>

      • The result of the search within the fetched collection.
    • Search for objects in this collection by another object using a vector-based similarity search.

      See the docs for a more detailed explanation.

      This overload is for performing a search with the groupBy param.

      Type Parameters

      • I extends IncludeVector<V>
      • RV

      Parameters

      • id: string

        The UUID of the object to search for.

      • opts: GroupByNearOptions<T, V, I>

        The available options for the search including the groupBy param.

      Returns Promise<GroupByReturn<T, RV>>

      • The group by result of the search within the fetched collection.
    • Search for objects in this collection by another object using a vector-based similarity search.

      See the docs for a more detailed explanation.

      This overload is for performing a search with a programmatically defined opts param.

      Type Parameters

      • I extends IncludeVector<V>
      • RV

      Parameters

      • id: string

        The UUID of the object to search for.

      • Optionalopts: NearOptions<T, V, I>

        The available options for the search.

      Returns QueryReturn<T, RV>

      • The result of the search within the fetched collection.
    • Search for objects in this collection by text using text-capable vectorization module and vector-based similarity search. You must have a text-capable vectorization module installed in order to use this method, e.g. any of the text2vec- and multi2vec- modules.

      See the docs for a more detailed explanation.

      This overload is for performing a search without the groupBy param.

      Type Parameters

      • I extends IncludeVector<V>
      • RV

      Parameters

      • query: string | string[]

        The text query to search for.

      • Optionalopts: BaseNearTextOptions<T, V, I>

        The available options for the search excluding the groupBy param.

      Returns Promise<WeaviateReturn<T, RV>>

      • The result of the search within the fetched collection.
    • Search for objects in this collection by text using text-capable vectorization module and vector-based similarity search. You must have a text-capable vectorization module installed in order to use this method, e.g. any of the text2vec- and multi2vec- modules.

      See the docs for a more detailed explanation.

      This overload is for performing a search with the groupBy param.

      Type Parameters

      • I extends IncludeVector<V>
      • RV

      Parameters

      • query: string | string[]

        The text query to search for.

      • opts: GroupByNearTextOptions<T, V, I>

        The available options for the search including the groupBy param.

      Returns Promise<GroupByReturn<T, RV>>

      • The group by result of the search within the fetched collection.
    • Search for objects in this collection by text using text-capable vectorization module and vector-based similarity search. You must have a text-capable vectorization module installed in order to use this method, e.g. any of the text2vec- and multi2vec- modules.

      See the docs for a more detailed explanation.

      This overload is for performing a search with a programmatically defined opts param.

      Type Parameters

      • I extends IncludeVector<V>
      • RV

      Parameters

      • query: string | string[]

        The text query to search for.

      • Optionalopts: NearTextOptions<T, V, I>

        The available options for the search.

      Returns QueryReturn<T, RV>

      • The result of the search within the fetched collection.
    • Search for objects by vector in this collection using a vector-based similarity search.

      See the docs for a more detailed explanation.

      This overload is for performing a search without the groupBy param.

      Type Parameters

      • I extends IncludeVector<V>
      • RV

      Parameters

      • vector: NearVectorInputType

        The vector(s) to search on.

      • Optionalopts: BaseNearOptions<T, V, I>

        The available options for the search excluding the groupBy param.

      Returns Promise<WeaviateReturn<T, RV>>

      • The result of the search within the fetched collection.
    • Search for objects by vector in this collection using a vector-based similarity search.

      See the docs for a more detailed explanation.

      This overload is for performing a search with the groupBy param.

      Type Parameters

      • I extends IncludeVector<V>
      • RV

      Parameters

      • vector: NearVectorInputType

        The vector(s) to search for.

      • opts: GroupByNearOptions<T, V, I>

        The available options for the search including the groupBy param.

      Returns Promise<GroupByReturn<T, RV>>

      • The group by result of the search within the fetched collection.
    • Search for objects by vector in this collection using a vector-based similarity search.

      See the docs for a more detailed explanation.

      This overload is for performing a search with a programmatically defined opts param.

      Type Parameters

      • I extends IncludeVector<V>
      • RV

      Parameters

      • vector: NearVectorInputType

        The vector(s) to search for.

      • Optionalopts: NearOptions<T, V, I>

        The available options for the search.

      Returns QueryReturn<T, RV>

      • The result of the search within the fetched collection.