elasticsearch/docs/reference/query-dsl
Julie Tibshirani 3c1b070329
Avoid negative scores with cross_fields type (#89016)
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-06 13:02:24 -07:00
..
_query-template.asciidoc [DOCS] Fix capitalization for Query DSL (#69236) 2021-02-18 18:57:19 -05:00
bool-query.asciidoc [DOCS] Fix double spaces (#71082) 2021-03-31 09:57:47 -04:00
boosting-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) 2020-07-21 12:24:26 -04:00
combined-fields-query.asciidoc [DOCS] Fix combined_fields query ref in multi_match query docs (#81456) 2021-12-07 16:47:44 -05:00
compound-queries.asciidoc [DOCS] Fix double spaces (#71082) 2021-03-31 09:57:47 -04:00
constant-score-query.asciidoc [DOCS] Replace twitter dataset in docs (#60604) 2020-08-03 12:49:56 -04:00
dis-max-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) 2020-07-21 12:24:26 -04:00
distance-feature-query.asciidoc [DOCS] Change // CONSOLE comments to [source,console] (#46440) 2019-09-09 10:45:37 -04:00
exists-query.asciidoc [DOCS] Replace twitter dataset in docs (#60604) 2020-08-03 12:49:56 -04:00
full-text-queries.asciidoc Introduce combined_fields query (#71213) 2021-04-14 13:33:19 -07:00
function-score-query.asciidoc [DOCS] Correct spelling for geo terms (#76028) 2021-08-03 09:55:48 -04:00
fuzzy-query.asciidoc [DOCS] Fix case for 'Boolean' (#64299) 2020-10-29 09:04:43 -04:00
geo-bounding-box-query.asciidoc Fix: Update geo-bounding-box-query.asciidoc (#87459) (#89301) 2022-08-12 18:38:05 +09:30
geo-distance-query.asciidoc Fix typo in geo-distance-query doc (#89148) 2022-08-08 09:59:47 +02:00
geo-grid-query.asciidoc new geo_grid query to be used with geogrid aggregations (#86596) 2022-05-23 11:38:07 +02:00
geo-polygon-query.asciidoc [DOCS] Remove camel case variations (#88650) 2022-07-20 17:06:34 +02:00
geo-queries.asciidoc new geo_grid query to be used with geogrid aggregations (#86596) 2022-05-23 11:38:07 +02:00
geo-shape-query.asciidoc [DOCS] Remove camel case variations (#88650) 2022-07-20 17:06:34 +02:00
has-child-query.asciidoc [DOCS] Fix case for 'Boolean' (#64299) 2020-10-29 09:04:43 -04:00
has-parent-query.asciidoc [DOCS] Fix case for 'Boolean' (#64299) 2020-10-29 09:04:43 -04:00
ids-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) 2020-07-21 12:24:26 -04:00
intervals-query.asciidoc [DOCS] Fix double spaces (#71082) 2021-03-31 09:57:47 -04:00
joining-queries.asciidoc [DOCS] Fix double spaces (#71082) 2021-03-31 09:57:47 -04:00
match-all-query.asciidoc [DOCS] Swap [float] for [discrete] (#60124) 2020-07-23 11:48:22 -04:00
match-bool-prefix-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) 2020-07-21 12:24:26 -04:00
match-phrase-prefix-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) 2020-07-21 12:24:26 -04:00
match-phrase-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) 2020-07-21 12:24:26 -04:00
match-query.asciidoc [DOCS] Fix case for 'Boolean' (#64299) 2020-10-29 09:04:43 -04:00
minimum-should-match.asciidoc [Docs] Fix typo in minimum-should-match.asciidoc (#46472) 2019-09-09 14:17:49 +02:00
mlt-query.asciidoc [DOCS] Document index.query.default_field index setting (#69922) 2021-03-17 17:11:25 -04:00
multi-match-query.asciidoc Avoid negative scores with cross_fields type (#89016) 2022-09-06 13:02:24 -07:00
multi-term-rewrite.asciidoc [DOCS] Replace Wikipedia links with attribute (#61171) 2020-08-17 09:44:24 -04:00
nested-query.asciidoc [DOCS] Clarify nested query behavior for must_not clauses (#82727) 2022-01-18 10:14:26 -05:00
parent-id-query.asciidoc [DOCS] Fix typo in parent-child example request (#76646) 2021-08-18 08:59:36 -04:00
percolate-query.asciidoc [DOCS] Fix percolate query headings (#83988) 2022-02-15 15:56:04 -05:00
pinned-query.asciidoc [DOCS] Remove testenv annotations from doc snippet tests (#80023) 2021-11-05 18:38:50 -04:00
prefix-query.asciidoc [DOCS] Clarify index_prefix in prefix query docs (#87450) 2022-06-14 14:32:37 +02:00
query-string-query.asciidoc [DOCS] Note that default_field support wildcards (#81127) 2022-01-04 08:26:13 -05:00
query-string-syntax.asciidoc [DOCS] Query strings are normalized for fuzzy (~) operator (#73921) 2021-06-28 13:13:41 -04:00
query_filter_context.asciidoc [DOCS] Fix double spaces (#71082) 2021-03-31 09:57:47 -04:00
range-query.asciidoc Fix range query on date fields for number inputs (#63692) 2020-12-01 18:49:50 +01:00
rank-feature-query.asciidoc [DOCS] Fix track_total_hits xref (#82739) 2022-01-18 12:43:17 -05:00
regexp-query.asciidoc [DOCS] Note case_sensitive param was added in 7.10 (#69405) (#69466) 2021-02-23 13:12:28 -05:00
regexp-syntax.asciidoc [DOCS] Adds note about escaping backslashes in regex (#89276) 2022-08-17 09:40:30 +02:00
script-query.asciidoc [DOCS] Update runtime fields for script query (#71338) 2021-04-06 10:12:08 -04:00
script-score-query.asciidoc Undeprecate function_score query (#87807) 2022-06-17 11:04:26 -04:00
shape-queries.asciidoc [DOCS] Remove testenv annotations from doc snippet tests (#80023) 2021-11-05 18:38:50 -04:00
shape-query.asciidoc [DOCS] Remove testenv annotations from doc snippet tests (#80023) 2021-11-05 18:38:50 -04:00
simple-query-string-query.asciidoc [DOCS] Expand simple query string query's multi-position token section (#68753) 2021-02-09 16:07:02 -05:00
span-containing-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) 2020-07-21 12:24:26 -04:00
span-field-masking-query.asciidoc Rename field_masking_span to span_field_masking (#74718) 2021-07-09 08:56:38 +01:00
span-first-query.asciidoc [DOCS] Replace twitter dataset in docs (#60604) 2020-08-03 12:49:56 -04:00
span-multi-term-query.asciidoc indices.query.bool.max_clause_count now limits all query clauses (#75297) 2021-07-21 12:16:30 +02:00
span-near-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) 2020-07-21 12:24:26 -04:00
span-not-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) 2020-07-21 12:24:26 -04:00
span-or-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) 2020-07-21 12:24:26 -04:00
span-queries.asciidoc Rename field_masking_span to span_field_masking (#74718) 2021-07-09 08:56:38 +01:00
span-term-query.asciidoc [DOCS] Replace twitter dataset in docs (#60604) 2020-08-03 12:49:56 -04:00
span-within-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) 2020-07-21 12:24:26 -04:00
special-queries.asciidoc [DOCS] Correct spelling for geo terms (#76028) 2021-08-03 09:55:48 -04:00
term-level-queries.asciidoc [DOCS] Replace Wikipedia links with attribute (#61171) 2020-08-17 09:44:24 -04:00
term-query.asciidoc [DOCS] Note case_sensitive param was added in 7.10 (#69405) (#69466) 2021-02-23 13:12:28 -05:00
terms-query.asciidoc [DOCS] Re-add network traffic para to term query (#83047) 2022-01-25 10:27:10 -05:00
terms-set-query.asciidoc [DOCS] Reformat snippets to use two-space indents (#59973) 2020-07-21 12:24:26 -04:00
wildcard-query.asciidoc [DOCS] Add wildcard parameter to wildcard query docs (#79722) 2021-10-26 12:35:11 -04:00
wrapper-query.asciidoc [DOCS] Replace twitter dataset in docs (#60604) 2020-08-03 12:49:56 -04:00