Movatterモバイル変換


[0]ホーム

URL:


Loading
  1. Elastic Docs/
  2. Reference/
  3. Elasticsearch/
  4. Mapping/
  5. Field data types

Binary field type

Thebinary type accepts a binary value as aBase64 encoded string. The field is not stored by default and is not searchable:

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. The Base64 encoded binary value must not have embedded newlines\n.

The following parameters are accepted bybinary fields:

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? Acceptstrue orfalse (default). This parameter will be automatically set totrue for TSDB indices (indices that haveindex.mode set totime_series).
store
Whether the field value should be stored and retrievable separately from the_source field. Acceptstrue orfalse (default).

Synthetic source may sortbinary values in order of their byte representation. For example:

PUT idx{  "settings": {    "index": {      "mapping": {        "source": {          "mode": "synthetic"        }      }    }  },  "mappings": {    "properties": {      "binary": { "type": "binary", "doc_values": true }    }  }}PUT idx/_doc/1{  "binary": ["IAA=", "EAA="]}

Will become:

{  "binary": ["EAA=", "IAA="]}

[8]ページ先頭

©2009-2026 Movatter.jp