# Evade base64 binary data encoding

**URL:** https://discuss.elastic.co/t/evade-base64-binary-data-encoding/73218
**Category:** Elasticsearch
**Created:** [January 30, 2017, 2:07pm UTC](https://discuss.elastic.co/t/evade-base64-binary-data-encoding/73218 "2017-01-30T14:07:07Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![vglazkov](https://avatars.discourse-cdn.com/v4/letter/v/ecc23a/32.png) [@vglazkov](https://discuss.elastic.co/u/vglazkov)
#### Post date: [January 30, 2017, 2:07pm UTC](https://discuss.elastic.co/t/evade-base64-binary-data-encoding/73218/1 "2017-01-30T14:07:07Z")

</div>

Hi!

Is there any way to store binary data fields without base64 encoding? I have a bunch of such fields in each document and it will be costly for me to encode/decode them every time. I don't want to index them. Or is there a possibility for Elasticsearch plugin to get low-level Lucene API interface? Because, as far as I know, they have StoredField:  
[https://lucene.apache.org/core/5\_3\_1/core/org/apache/lucene/document/StoredField.html#StoredField(java.lang.String,%20byte[])](https://lucene.apache.org/core/5_3_1/core/org/apache/lucene/document/StoredField.html#StoredField(java.lang.String,%20byte%5B%5D))

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [January 31, 2017, 9:33am UTC](https://discuss.elastic.co/t/evade-base64-binary-data-encoding/73218/2 "2017-01-31T09:33:39Z")

</div>

Hey,

as Elasticsearch also supports CBOR, which would allow you to sent binary data to elasticsearch as byte streams. That way you could circumvent the conversion on the cost that your client has to speak this protocol.

--Alex

---

<div class="post-metadata">

### Author: ![vglazkov](https://avatars.discourse-cdn.com/v4/letter/v/ecc23a/32.png) [@vglazkov](https://discuss.elastic.co/u/vglazkov)
#### Post date: [January 31, 2017, 2:23pm UTC](https://discuss.elastic.co/t/evade-base64-binary-data-encoding/73218/3 "2017-01-31T14:23:23Z")

</div>

Hi, Alexander!

Thanks for your answer. Can you please point me out to some examples with Elastic and CBOR?

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [February 1, 2017, 8:23am UTC](https://discuss.elastic.co/t/evade-base64-binary-data-encoding/73218/4 "2017-02-01T08:23:55Z")

</div>

Hey,

I think the only way to look at are the tests in the elasticsearch repository. The following tests are mentioning CBOR

- CborFilteringGeneratorTests
- CborXContentTests
- JsonVsCborTests
- RestTableTests
- XContentFactoryTests
- XContentTypeTests

also checking out the underlying implementation (jackson) that serializes/unserializes CBOR makes sense.

Hope this helps.

--Alex

---

<div class="post-metadata">

### Author: ![vglazkov](https://avatars.discourse-cdn.com/v4/letter/v/ecc23a/32.png) [@vglazkov](https://discuss.elastic.co/u/vglazkov)
#### Post date: [February 3, 2017, 2:17pm UTC](https://discuss.elastic.co/t/evade-base64-binary-data-encoding/73218/5 "2017-02-03T14:17:31Z")

</div>

Thanks, will check it out!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 3, 2017, 2:17pm UTC](https://discuss.elastic.co/t/evade-base64-binary-data-encoding/73218/6 "2017-03-03T14:17:40Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
