跳到正文
本页尚未翻译成中文,以下为英文原文。 查看英文版

Binary field type ​

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

Example ​

Create a mapping with a binary field:

json
PUT testindex 
{
  "mappings" : {
    "properties" :  {
      "binary_value" : {
        "type" : "binary"
      }
    }
  }
}

Index a document with a binary value:

json
PUT testindex/_doc/1 
{
  "binary_value" : "bGlkaHQtd29rfx4="
}

NOTE

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 true.
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.