elasticsearch/docs/reference/query-dsl
Julie Tibshirani 738e60ca5f
Avoid negative scores with cross_fields type (#89843)
The cross_fields scoring type can produce negative scores when some documents
are missing fields. When blending term document frequencies, we take the maximum
document frequency across all fields. If one field appears in fewer documents
than another, this means that its IDF can become negative. This is because IDF
is calculated as `Math.log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5))`

This change adjusts the docFreq for each field to `Math.min(docCount, docFreq)`
so that the IDF can never become negative. It makes sense that the term document
frequency should never exceed the number of documents containing the field.
2022-09-07 07:58:15 -07:00
..
_query-template.asciidoc [DOCS] Fix capitalization for Query DSL (#69236) (#69240) 2021-02-18 19:40:36 -05:00
bool-query.asciidoc [DOCS] Fix double spaces (#71082) (#71120) 2021-03-31 11:43:34 -04:00
boosting-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) (#59994) 2020-07-21 15:49:58 -04:00
combined-fields-query.asciidoc [DOCS] Fix combined_fields query ref in multi_match query docs (#81456) (#81472) 2021-12-07 17:09:35 -05:00
common-terms-query.asciidoc [DOCS] Swap [float] for [discrete] (#60134) 2020-07-23 12:42:33 -04:00
compound-queries.asciidoc [DOCS] Fix double spaces (#71082) (#71120) 2021-03-31 11:43:34 -04:00
constant-score-query.asciidoc [DOCS] Replace twitter dataset in docs (#60604) (#60609) 2020-08-03 13:31:19 -04:00
dis-max-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) (#59994) 2020-07-21 15:49:58 -04:00
distance-feature-query.asciidoc [DOCS] Change // CONSOLE comments to [source,console] (#46440) (#46494) 2019-09-09 12:35:50 -04:00
exists-query.asciidoc [DOCS] Replace twitter dataset in docs (#60604) (#60609) 2020-08-03 13:31:19 -04:00
full-text-queries.asciidoc Introduce combined_fields query (#71711) 2021-04-14 16:04:37 -07:00
function-score-query.asciidoc [DOCS] Correct spelling for geo terms (#76028) (#76032) 2021-08-03 10:08:52 -04:00
fuzzy-query.asciidoc [DOCS] Fix case for 'Boolean' (#64299) (#64341) 2020-10-29 10:04:20 -04:00
geo-bounding-box-query.asciidoc [DOCS] Correct spelling for geo terms (#76028) (#76032) 2021-08-03 10:08:52 -04:00
geo-distance-query.asciidoc Enable geo_distance and geo_bounding_box queries on geo_shape field type (#64224) (#64326) 2020-10-29 10:49:45 +01:00
geo-polygon-query.asciidoc [DOCS] Correct spelling for geo terms (#76028) (#76032) 2021-08-03 10:08:52 -04:00
geo-queries.asciidoc [DOCS] Correct spelling for geo terms (#76028) (#76032) 2021-08-03 10:08:52 -04:00
geo-shape-query.asciidoc [DOCS] Clarify geoshape orientation docs (#75888) (#77445) 2021-09-08 11:30:17 -04:00
has-child-query.asciidoc [DOCS] Fix case for 'Boolean' (#64299) (#64341) 2020-10-29 10:04:20 -04:00
has-parent-query.asciidoc [DOCS] Fix case for 'Boolean' (#64299) (#64341) 2020-10-29 10:04:20 -04:00
ids-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) (#59994) 2020-07-21 15:49:58 -04:00
intervals-query.asciidoc [DOCS] Fix double spaces (#71082) (#71120) 2021-03-31 11:43:34 -04:00
joining-queries.asciidoc [DOCS] Fix double spaces (#71082) (#71120) 2021-03-31 11:43:34 -04:00
match-all-query.asciidoc [DOCS] Swap [float] for [discrete] (#60134) 2020-07-23 12:42:33 -04:00
match-bool-prefix-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) (#59994) 2020-07-21 15:49:58 -04:00
match-phrase-prefix-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) (#59994) 2020-07-21 15:49:58 -04:00
match-phrase-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) (#59994) 2020-07-21 15:49:58 -04:00
match-query.asciidoc [DOCS] Fix case for 'Boolean' (#64299) (#64341) 2020-10-29 10:04:20 -04:00
minimum-should-match.asciidoc [Docs] Fix typo in minimum-should-match.asciidoc (#46472) 2019-09-09 14:17:19 +02:00
mlt-query.asciidoc [DOCS] Document index.query.default_field index setting (#69922) (#70528) 2021-03-17 17:35:08 -04:00
multi-match-query.asciidoc Avoid negative scores with cross_fields type (#89843) 2022-09-07 07:58:15 -07:00
multi-term-rewrite.asciidoc [DOCS] Replace Wikipedia links with attribute (#61171) (#61209) 2020-08-17 11:27:04 -04:00
nested-query.asciidoc [7.17] [DOCS] Clarify nested query behavior for must_not clauses (#82727) (#82735) 2022-01-18 10:53:30 -05:00
parent-id-query.asciidoc [DOCS] Fix typo in parent-child example request (#76646) (#76655) 2021-08-18 09:16:25 -04:00
percolate-query.asciidoc [DOCS] Move tip for percolate query example (#83972) (#83986) 2022-02-15 16:10:12 -05:00
pinned-query.asciidoc [DOCS] Remove testenv annotations from doc snippet tests (#80023) (#80458) 2021-11-05 19:41:54 -04:00
prefix-query.asciidoc [DOCS] Clarify index_prefix in prefix query docs (#87450) 2022-06-14 14:46:25 +02:00
query-string-query.asciidoc [DOCS] Note that default_field support wildcards (#81127) (#82199) 2022-01-04 08:44:09 -05:00
query-string-syntax.asciidoc [DOCS] Query strings are normalized for fuzzy (~) operator (#73921) (#74645) 2021-06-28 13:28:23 -04:00
query_filter_context.asciidoc [DOCS] Fix double spaces (#71082) (#71120) 2021-03-31 11:43:34 -04:00
range-query.asciidoc [doc] Rounding range query rules backport(#63109) (#63155) 2020-10-02 09:40:01 +02:00
rank-feature-query.asciidoc [DOCS] Fix track_total_hits xref (#82739) (#82752) 2022-01-18 12:56:52 -05:00
regexp-query.asciidoc [DOCS] Note case_sensitive param was added in 7.10 (#69405) (#69467) 2021-02-23 13:12:35 -05:00
regexp-syntax.asciidoc [DOCS] Document missing flag values for regexp query (#82265) (#82761) 2022-01-18 14:28:24 -05:00
script-query.asciidoc [DOCS] Update runtime fields for script query (#71338) (#71347) 2021-04-06 11:01:28 -04:00
script-score-query.asciidoc Undeprecate function_score query (#87807) 2022-06-17 11:08:47 -04:00
shape-queries.asciidoc [DOCS] Remove testenv annotations from doc snippet tests (#80023) (#80458) 2021-11-05 19:41:54 -04:00
shape-query.asciidoc [DOCS] Remove testenv annotations from doc snippet tests (#80023) (#80458) 2021-11-05 19:41:54 -04:00
simple-query-string-query.asciidoc [DOCS] Expand simple query string query's multi-position token section (#68753) (#68784) 2021-02-09 17:12:39 -05:00
span-containing-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) (#59994) 2020-07-21 15:49:58 -04:00
span-field-masking-query.asciidoc Rename field_masking_span to span_field_masking (#74718) 2021-07-09 09:08:30 +01:00
span-first-query.asciidoc [DOCS] Replace twitter dataset in docs (#60604) (#60609) 2020-08-03 13:31:19 -04:00
span-multi-term-query.asciidoc [DOCS] Fix query docs formatting (#60752) (#60760) 2020-08-05 12:47:42 -04:00
span-near-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) (#59994) 2020-07-21 15:49:58 -04:00
span-not-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) (#59994) 2020-07-21 15:49:58 -04:00
span-or-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) (#59994) 2020-07-21 15:49:58 -04:00
span-queries.asciidoc Rename field_masking_span to span_field_masking (#74718) 2021-07-09 09:08:30 +01:00
span-term-query.asciidoc [DOCS] Replace twitter dataset in docs (#60604) (#60609) 2020-08-03 13:31:19 -04:00
span-within-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) (#59994) 2020-07-21 15:49:58 -04:00
special-queries.asciidoc [DOCS] Correct spelling for geo terms (#76028) (#76032) 2021-08-03 10:08:52 -04:00
term-level-queries.asciidoc [DOCS] Replace Wikipedia links with attribute (#61171) (#61209) 2020-08-17 11:27:04 -04:00
term-query.asciidoc [DOCS] Note case_sensitive param was added in 7.10 (#69405) (#69467) 2021-02-23 13:12:35 -05:00
terms-query.asciidoc [DOCS] Re-add network traffic para to term query (#83047) (#83067) 2022-01-25 10:39:01 -05:00
terms-set-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) (#59994) 2020-07-21 15:49:58 -04:00
type-query.asciidoc [7.x] [DOCS] Reformat snippets to use two-space indents (#60080) 2020-07-22 15:57:49 -04:00
wildcard-query.asciidoc [DOCS] Add wildcard parameter to wildcard query docs (#79722) (#79853) 2021-10-26 12:45:22 -04:00
wrapper-query.asciidoc [DOCS] Replace twitter dataset in docs (#60604) (#60609) 2020-08-03 13:31:19 -04:00