Interface Query<T>

All the available methods on the .query namespace.

interface Query<T> {
    fetchObjectById: ((id, opts?) => Promise<null | WeaviateObject<T>>);
    fetchObjects: ((opts?) => Promise<WeaviateReturn<T>>);
    bm25(query, opts?): Promise<WeaviateReturn<T>>;
    bm25(query, opts): Promise<GroupByReturn<T>>;
    bm25(query, opts?): QueryReturn<T>;
    hybrid(query, opts?): Promise<WeaviateReturn<T>>;
    hybrid(query, opts): Promise<GroupByReturn<T>>;
    hybrid(query, opts?): QueryReturn<T>;
    nearImage(image, opts?): Promise<WeaviateReturn<T>>;
    nearImage(image, opts): Promise<GroupByReturn<T>>;
    nearImage(image, opts?): QueryReturn<T>;
    nearMedia(media, type, opts?): Promise<WeaviateReturn<T>>;
    nearMedia(media, type, opts): Promise<GroupByReturn<T>>;
    nearMedia(media, type, opts?): QueryReturn<T>;
    nearObject(id, opts?): Promise<WeaviateReturn<T>>;
    nearObject(id, opts): Promise<GroupByReturn<T>>;
    nearObject(id, opts?): QueryReturn<T>;
    nearText(query, opts?): Promise<WeaviateReturn<T>>;
    nearText(query, opts): Promise<GroupByReturn<T>>;
    nearText(query, opts?): QueryReturn<T>;
    nearVector(vector, opts?): Promise<WeaviateReturn<T>>;
    nearVector(vector, opts): Promise<GroupByReturn<T>>;
    nearVector(vector, opts?): QueryReturn<T>;
}

Type Parameters

  • T

Hierarchy

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

Properties

fetchObjectById: ((id, opts?) => Promise<null | WeaviateObject<T>>)

Retrieve an object from the server by its UUID.

Type declaration

Returns

  • The object with the given UUID, or null if it does not exist.
fetchObjects: ((opts?) => Promise<WeaviateReturn<T>>)

Retrieve objects from the server without searching.

Type declaration

Returns

  • The objects within the fetched collection.

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.

    Parameters

    • query: string

      The query to search for.

    • Optional opts: BaseBm25Options<T>

      The available options for the search excluding the groupBy param.

    Returns Promise<WeaviateReturn<T>>

    • 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.

    Parameters

    • query: string

      The query to search for.

    • opts: GroupByBm25Options<T>

      The available options for the search including the groupBy param.

    Returns Promise<GroupByReturn<T>>

    • 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.

    Parameters

    • query: string

      The query to search for.

    • Optional opts: Bm25Options<T>

      The available options for the search including the groupBy param.

    Returns QueryReturn<T>

    • 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.

    Parameters

    • query: string

      The query to search for.

    • Optional opts: BaseHybridOptions<T>

      The available options for the search excluding the groupBy param.

    Returns Promise<WeaviateReturn<T>>

    • 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.

    Parameters

    • query: string

      The query to search for.

    • opts: GroupByHybridOptions<T>

      The available options for the search including the groupBy param.

    Returns Promise<GroupByReturn<T>>

    • 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.

    Parameters

    • query: string

      The query to search for.

    • Optional opts: HybridOptions<T>

      The available options for the search including the groupBy param.

    Returns QueryReturn<T>

    • 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.

    @param {string | Buffer} image - The image to search on. This can be a base64 string, a file path string, or a buffer. @param {BaseNearOptions} [opts] - The available options for the search excluding the groupBy param.

    Parameters

    Returns Promise<WeaviateReturn<T>>

    • 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.

    @param {string | Buffer} image - The image to search on. This can be a base64 string, a file path string, or a buffer. @param {GroupByNearOptions} opts - The available options for the search including the groupBy param.

    Parameters

    Returns Promise<GroupByReturn<T>>

    • 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.

    Parameters

    • image: string | Buffer

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

    • Optional opts: NearOptions<T>

      The available options for the search.

    Returns QueryReturn<T>

    • 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.

    Parameters

    • media: string | Buffer

      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'.

    • Optional opts: BaseNearOptions<T>

      The available options for the search excluding the groupBy param.

    Returns Promise<WeaviateReturn<T>>

    • 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.

    Parameters

    • media: string | Buffer

      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>

      The available options for the search including the groupBy param.

    Returns Promise<GroupByReturn<T>>

    • 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.

    Parameters

    • media: string | Buffer

      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'.

    • Optional opts: NearOptions<T>

      The available options for the search.

    Returns QueryReturn<T>

    • 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.

    Parameters

    • id: string

      The UUID of the object to search for.

    • Optional opts: BaseNearOptions<T>

      The available options for the search excluding the groupBy param.

    Returns Promise<WeaviateReturn<T>>

    • 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.

    Parameters

    • id: string

      The UUID of the object to search for.

    • opts: GroupByNearOptions<T>

      The available options for the search including the groupBy param.

    Returns Promise<GroupByReturn<T>>

    • 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.

    Parameters

    • id: string

      The UUID of the object to search for.

    • Optional opts: NearOptions<T>

      The available options for the search.

    Returns QueryReturn<T>

    • 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.

    Parameters

    • query: string | string[]

      The text query to search for.

    • Optional opts: BaseNearTextOptions<T>

      The available options for the search excluding the groupBy param.

    Returns Promise<WeaviateReturn<T>>

    • 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.

    Parameters

    • query: string | string[]

      The text query to search for.

    • opts: GroupByNearTextOptions<T>

      The available options for the search including the groupBy param.

    Returns Promise<GroupByReturn<T>>

    • 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.

    Parameters

    • query: string | string[]

      The text query to search for.

    • Optional opts: NearTextOptions<T>

      The available options for the search.

    Returns QueryReturn<T>

    • 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.

    Parameters

    • vector: NearVectorInputType

      The vector(s) to search on.

    • Optional opts: BaseNearOptions<T>

      The available options for the search excluding the groupBy param.

    Returns Promise<WeaviateReturn<T>>

    • 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.

    Parameters

    • vector: NearVectorInputType

      The vector(s) to search for.

    • opts: GroupByNearOptions<T>

      The available options for the search including the groupBy param.

    Returns Promise<GroupByReturn<T>>

    • 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.

    Parameters

    • vector: NearVectorInputType

      The vector(s) to search for.

    • Optional opts: NearOptions<T>

      The available options for the search.

    Returns QueryReturn<T>

    • The result of the search within the fetched collection.