Binary field type

Introduced 1.0

A binary field type contains a binary value in Base64 encoding that is not searchable.

Example

Create a mapping with a binary field:

  1. PUT testindex
  2. {
  3. "mappings" : {
  4. "properties" : {
  5. "binary_value" : {
  6. "type" : "binary"
  7. }
  8. }
  9. }
  10. }

copy

Index a document with a binary value:

  1. PUT testindex/_doc/1
  2. {
  3. "binary_value" : "bGlkaHQtd29rfx4="
  4. }

copy

Use = as a padding character. Embedded newline characters are not allowed.

Parameters

The following table lists the parameters accepted by binary field types. All parameters are optional.

ParameterDescription
doc_valuesA Boolean value that specifies whether the field should be stored on disk so that it can be used for aggregations, sorting, or scripting. Optional. Default is false.
storeA Boolean value that specifies whether the field value should be stored and can be retrieved separately from the _source field. Optional. Default is false.