norms.asciidoc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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: Norms can be disabled on existing fields using
  12. the <<indices-put-mapping,PUT mapping API>>.
  13. Norms can be disabled (but not reenabled after the fact), using the
  14. <<indices-put-mapping,PUT mapping API>> like so:
  15. [source,console]
  16. ------------
  17. PUT my_index/_mapping
  18. {
  19. "properties": {
  20. "title": {
  21. "type": "text",
  22. "norms": false
  23. }
  24. }
  25. }
  26. ------------
  27. // TEST[s/^/PUT my_index\n/]
  28. NOTE: Norms will not be removed instantly, but will be removed as old segments
  29. are merged into new segments as you continue indexing new documents. Any score
  30. computation on a field that has had norms removed might return inconsistent
  31. results since some documents won't have norms anymore while other documents
  32. might still have norms.