elasticsearch/docs/reference/query-languages/query-dsl-constant-score-query.md
Colleen McGinnis b7e3a1e14b
[docs] Migrate docs from AsciiDoc to Markdown (#123507)
* delete asciidoc files

* add migrated files

* fix errors

* Disable docs tests

* Clarify release notes page titles

* Revert "Clarify release notes page titles"

This reverts commit 8be688648d.

* Comment out edternal URI images

* Clean up query languages landing pages, link to conceptual docs

* Add .md to url

* Fixes inference processor nesting.

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
Co-authored-by: Liam Thompson <leemthompo@gmail.com>
Co-authored-by: Martijn Laarman <Mpdreamz@gmail.com>
Co-authored-by: István Zoltán Szabó <szabosteve@gmail.com>
2025-02-27 17:56:14 +01:00

1.3 KiB

navigation_title mapped_pages
Constant score
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-constant-score-query.html

Constant score query [query-dsl-constant-score-query]

Wraps a filter query and returns every matching document with a relevance score equal to the boost parameter value.

GET /_search
{
  "query": {
    "constant_score": {
      "filter": {
        "term": { "user.id": "kimchy" }
      },
      "boost": 1.2
    }
  }
}

Top-level parameters for constant_score [constant-score-top-level-params]

filter
(Required, query object) Filter query you wish to run. Any returned documents must match this query.

Filter queries do not calculate relevance scores. To speed up performance, {{es}} automatically caches frequently used filter queries.

boost
(Optional, float) Floating point number used as the constant relevance score for every document matching the filter query. Defaults to 1.0.