[[binary]]
=== Binary field type
++++
<titleabbrev>Binary</titleabbrev>
++++

The `binary` type accepts a binary value as a
{wikipedia}/Base64[Base64] encoded string. The field is not
stored by default and is not searchable:

[source,console]
--------------------------------------------------
PUT my-index-000001
{
  "mappings": {
    "properties": {
      "name": {
        "type": "text"
      },
      "blob": {
        "type": "binary"
      }
    }
  }
}

PUT my-index-000001/_doc/1
{
  "name": "Some binary blob",
  "blob": "U29tZSBiaW5hcnkgYmxvYg==" <1>
}
--------------------------------------------------

<1> The Base64 encoded binary value must not have embedded newlines `\n`.

[[binary-params]]
==== Parameters for `binary` fields

The following parameters are accepted by `binary` fields:

[horizontal]

<<doc-values,`doc_values`>>::

    Should the field be stored on disk in a column-stride fashion, so that it
    can later be used for sorting, aggregations, or scripting? Accepts `true`
    or `false` (default).

<<mapping-store,`store`>>::

    Whether the field value should be stored and retrievable separately from
    the <<mapping-source-field,`_source`>> field. Accepts `true` or `false`
    (default).
