norms.asciidoc 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. [[norms]]
  2. === `norms`
  3. Norms store various normalization factors that are later used at query time
  4. in order to compute the score of a document relatively to a query.
  5. Although useful for scoring, norms also require quite a lot of disk
  6. (typically in the order of one byte per document per field in your index, even
  7. for documents that don't have this specific field). As a consequence, if you
  8. don't need scoring on a specific field, you should disable norms on that
  9. field. In particular, this is the case for fields that are used solely for
  10. filtering or aggregations.
  11. TIP: The `norms` setting must have the same setting for fields of the
  12. same name in the same index. Norms can be disabled on existing fields using
  13. the <<indices-put-mapping,PUT mapping API>>.
  14. Norms can be disabled (but not reenabled) after the fact, using the
  15. <<indices-put-mapping,PUT mapping API>> like so:
  16. [source,js]
  17. ------------
  18. PUT my_index/_mapping/my_type
  19. {
  20. "properties": {
  21. "title": {
  22. "type": "text",
  23. "norms": false
  24. }
  25. }
  26. }
  27. ------------
  28. // AUTOSENSE
  29. NOTE: Norms will not be removed instantly, but will be removed as old segments
  30. are merged into new segments as you continue indexing new documents. Any score
  31. computation on a field that has had norms removed might return inconsistent
  32. results since some documents won't have norms anymore while other documents
  33. might still have norms.