norms.asciidoc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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
  19. {
  20. "properties": {
  21. "title": {
  22. "type": "text",
  23. "norms": false
  24. }
  25. }
  26. }
  27. ------------
  28. // CONSOLE
  29. // TEST[s/^/PUT my_index\n/]
  30. NOTE: Norms will not be removed instantly, but will be removed as old segments
  31. are merged into new segments as you continue indexing new documents. Any score
  32. computation on a field that has had norms removed might return inconsistent
  33. results since some documents won't have norms anymore while other documents
  34. might still have norms.