boost-field.asciidoc 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. [[mapping-boost-field]]
  2. === `_boost`
  3. Boosting is the process of enhancing the relevancy of a document or
  4. field. Field level mapping allows to define explicit boost level on a
  5. specific field. The boost field mapping (applied on the
  6. <<mapping-root-object-type,root object>>) allows
  7. to define a boost field mapping where *its content will control the
  8. boost level of the document*. For example, consider the following
  9. mapping:
  10. [source,js]
  11. --------------------------------------------------
  12. {
  13. "tweet" : {
  14. "_boost" : {"name" : "my_boost", "null_value" : 1.0}
  15. }
  16. }
  17. --------------------------------------------------
  18. The above mapping defines mapping for a field named `my_boost`. If the
  19. `my_boost` field exists within the JSON document indexed, its value will
  20. control the boost level of the document indexed. For example, the
  21. following JSON document will be indexed with a boost value of `2.2`:
  22. [source,js]
  23. --------------------------------------------------
  24. {
  25. "my_boost" : 2.2,
  26. "message" : "This is a tweet!"
  27. }
  28. --------------------------------------------------