2015-08-06 11:24:29 -04:00
|
|
|
[[norms]]
|
|
|
|
=== `norms`
|
|
|
|
|
2016-03-02 04:51:47 -05:00
|
|
|
Norms store various normalization factors that are later used at query time
|
|
|
|
in order to compute the score of a document relatively to a query.
|
2015-08-06 11:24:29 -04:00
|
|
|
|
2016-03-18 12:01:27 -04:00
|
|
|
Although useful for scoring, norms also require quite a lot of disk
|
2015-08-06 11:24:29 -04:00
|
|
|
(typically in the order of one byte per document per field in your index, even
|
|
|
|
for documents that don't have this specific field). As a consequence, if you
|
|
|
|
don't need scoring on a specific field, you should disable norms on that
|
|
|
|
field. In particular, this is the case for fields that are used solely for
|
|
|
|
filtering or aggregations.
|
|
|
|
|
2019-06-20 03:15:43 -04:00
|
|
|
TIP: Norms can be disabled on existing fields using
|
2015-08-12 15:21:37 -04:00
|
|
|
the <<indices-put-mapping,PUT mapping API>>.
|
|
|
|
|
2019-06-20 03:15:43 -04:00
|
|
|
Norms can be disabled (but not reenabled after the fact), using the
|
2015-08-06 11:24:29 -04:00
|
|
|
<<indices-put-mapping,PUT mapping API>> like so:
|
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2015-08-06 11:24:29 -04:00
|
|
|
------------
|
2020-07-27 15:58:26 -04:00
|
|
|
PUT my-index-000001/_mapping
|
2015-08-06 11:24:29 -04:00
|
|
|
{
|
|
|
|
"properties": {
|
|
|
|
"title": {
|
2016-03-18 12:01:27 -04:00
|
|
|
"type": "text",
|
|
|
|
"norms": false
|
2015-08-06 11:24:29 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
------------
|
2020-07-27 15:58:26 -04:00
|
|
|
// TEST[s/^/PUT my-index-000001\n/]
|
2015-08-06 11:24:29 -04:00
|
|
|
|
|
|
|
NOTE: Norms will not be removed instantly, but will be removed as old segments
|
|
|
|
are merged into new segments as you continue indexing new documents. Any score
|
|
|
|
computation on a field that has had norms removed might return inconsistent
|
|
|
|
results since some documents won't have norms anymore while other documents
|
|
|
|
might still have norms.
|