The Open API specification for Synapse is now available for download!

Download Open API Spec

HybridQuery

org.sagebionetworks.repo.model.search.dsl.HybridQuery

A hybrid query — several independently-scored clauses whose scores are normalized onto a common scale and then combined, so keyword and semantic relevance can be blended meaningfully. Supplied as SearchQuery.hybrid rather than inside query, because OpenSearch requires a hybrid query to be the top-level query.

The scores are normalized and combined by SearchQuery.search_pipeline; when it is omitted, the search configuration's default search pipeline is used, and failing that min_max normalization with an arithmetic_mean combination of equally-weighted clauses.

Results are ranked by relevance unless sort names a column. Pages requested with from / size are capped at from + size <= 1000. A relevance-ranked query emits no nextSearchAfter and rejects search_after; sorting by a column enables search_after paging.

Field Type Description
queries ARRAY<HybridClause> Required. An array of one or more query clauses that are used to match documents. A document must match at least one query clause in order to be returned in the results. The documents' relevance scores from all query clauses are combined into one score by applying a search pipeline. The maximum number of query clauses is 5.
filter Query

A single OpenSearch query DSL clause. Exactly one of the properties below may be set — the set property names the clause kind. See query vs. filter context and term-level vs. full-text queries.

The field-keyed leaf clauses (match, term, range, ...) are maps whose key is the column name and whose value is the per-field options object — only the long form is accepted (e.g. {"match":{"title":{"query":"x"}}}, not the {"match":{"title":"x"}} shorthand). The compound clauses (bool, dis_max, ...) nest further Query DSL clauses recursively.

min_score NUMBER Optional. Drop hits whose fused score — after normalization and combination — is below this value. Distinct from a leg's own neural.min_score, which bounds which candidates that leg contributes rather than the final combined score.