OptionalfieldA single field to score against. Equivalent to a one-element fields; prefer fields, which can also name more than one field. Either field or fields must be provided for dense_vector, sparse_vector, and text scoring types, but not both.
OptionalfieldsThe fields to score against.
Either fields or field must be provided for dense_vector, sparse_vector, and text scoring types, and neither may be provided for query_string. dense_vector and sparse_vector accept exactly one field; text accepts one or more.
OptionalqueryThe text query to use for text and query_string scoring types. Leading and trailing whitespace is trimmed; a query that is empty after trimming is rejected. At most 10 KB.
OptionalsparseThe scoring method type.
Possible values: dense_vector, sparse_vector, text, or query_string.
OptionalvaluesThe dense vector values to use for dense_vector scoring type.
A scoring method that defines how documents are scored against a query.
The
typefield determines which other fields are used:dense_vector: Score by dense vector similarity. Requires eitherfieldorfieldsnaming exactly one field, and avaluesarray.sparse_vector: Score by sparse vector similarity. Requires eitherfieldorfieldsnaming exactly one field, andsparse_values.text: Score by BM25 text similarity. Requires eitherfieldorfieldsnaming one or more fields, andquery. Naming several fields scores the query against all of them.query_string: Score using a Lucene query string. Use field qualifiers (field:(clause)) to target a field, or omit field qualifiers to search against all text-searchable fields. Errors iffieldorfieldsis provided.Export
DocumentScoringMethod