search

Search a collection with hybrid

Performs a hybrid search over the objects of a collection: the query is scored with the BM25F ranking function over the searchable text properties (all of them, or the queryProperties subset) and, in parallel, vectorized server-side and searched against the vector index; the two rankings are fused (per fusionType, weighted by alpha) and the best objects are returned, each as an envelope of its id, the selected properties, the selected references and, when requested, its retrieval metadata.

post/search/{collection}/hybrid

Request

  • Base URL: https://localhost:8080/v1
  • URL: https://localhost:8080/v1/search/{collection}/hybrid
  • Auth: one of:
    • none
    • OAuth 2 (implicit, authorization URL http://to-be-configured-in-the-application-config)

Path parameters

collectionstring required

The name (or alias) of the collection to search. A lowercase first letter is normalized to the canonical uppercase form.

Request body

limitinteger nullable

The maximum number of objects to return. Omitted or 0 falls back to the server default (QUERY_DEFAULTS_LIMIT); a value above QUERY_MAXIMUM_RESULTS is rejected.

offsetinteger nullable

The number of objects to skip before returning results. Used with limit for pagination.

autoLimitinteger nullable

Cut results off at the first steep drop in score (autocut). The value is the number of score jumps to allow before cutting.

returnPropertiesstring[]

The non-reference properties to return. Omitted returns all non-reference, non-blob properties; an empty array returns no properties. References are selected with returnReferences.

returnMetadatastring[]

The retrieval metadata to return under each result's metadata key. The object id is always returned as each result's id field. Omitted or empty returns no metadata block.

tenantstring

The tenant to search in a multi-tenant collection.

consistencyLevel'ONE' | 'QUORUM' | 'ALL'

The consistency level for the read.

singlePromptstring nullable

Reserved for per-object retrieval-augmented generation. Returns 422 (not yet supported).

groupedTaskstring nullable

Reserved for grouped retrieval-augmented generation. Returns 422 (not yet supported).

groupBystring nullable

Reserved for grouped search. Returns 422 (not yet supported).

numberOfGroupsinteger nullable

Reserved for grouped search. Returns 422 (not yet supported).

objectsPerGroupinteger nullable

Reserved for grouped search. Returns 422 (not yet supported).

querystring required

The query, as a plain string. It is scored with BM25F for the keyword part of the search and vectorized server-side for the vector part. Must not be empty.

alphanumber nullable

The weight of the vector part of the search, between 0 and 1. 0 is a pure keyword search, 1 a pure vector search. Omitted defaults to 0.75. With 0 the query is never vectorized, so a collection without a vectorizer module is searchable.

fusionType'ranked' | 'relativeScore'

The algorithm that fuses the keyword and vector rankings: ranked (reciprocal-rank fusion) or relativeScore (normalized-score fusion). Omitted defaults to relativeScore.

maxVectorDistancenumber nullable

The maximum vector distance of a match: objects farther than this from the query vector are excluded, from the keyword ranking too.

queryPropertiesstring[]

The properties the keyword part of the search scores against, each optionally weighted with a ^boost suffix (e.g. title^2). Omitted or empty searches every searchable text property. A property without a searchable index is rejected with 422.

targetVectorstring

The named vector to search. Required when the collection has more than one named vector.

Example request

{
  "where": {
    "operator": "GreaterThanEqual",
    "path": [
      "inCity",
      "city",
      "name"
    ],
    "valueInt": 2000,
    "valueNumber": 3.14,
    "valueString": "my search term",
    "valueText": "my search term",
    "valueDate": "TODO",
    "valueNumberArray": [
      3.14
    ],
    "valueBooleanArray": [
      true,
      false
    ],
    "valueStringArray": [
      "my search term"
    ],
    "valueTextArray": [
      "my search term"
    ]
  }
}

Response

Search performed successfully.

tookMsinteger required

Server-side processing time in milliseconds.

Changes

No recorded changes to this operation across all 1 revision of this API.