# Indexing a blob

**URL:** <https://discuss.elastic.co/t/indexing-a-blob/175211>\
**Category:** Elasticsearch\
**Created:** [April 3, 2019, 1:38pm UTC](https://discuss.elastic.co/t/indexing-a-blob/175211 "2019-04-03T13:38:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![freaka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/freaka/32/41962_2.png) [@freaka](https://discuss.elastic.co/u/freaka)\
**Post date:** [April 3, 2019, 1:38pm UTC](https://discuss.elastic.co/t/indexing-a-blob/175211/1 "2019-04-03T13:38:13Z")

</div>

Hi,

I am currently facing issues indexing documents that have fields with changing structure. Basically, things like this can happen:

```auto
    {
        "property-a": "hello"
    }
    {
        "property-a": { 
            "value": "hello",
            "type": "greeting"
    }

```

I was thinking of putting everything in a `String` but I thought maybe another solution exists.  
Is there any way to store the equivalent of a `blob` type ?

thanks,

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 3, 2019, 3:39pm UTC](https://discuss.elastic.co/t/indexing-a-blob/175211/2 "2019-04-03T15:39:13Z")

</div>

But do you want to search using those fields?

---

<div class="post-metadata">

**Author:** ![freaka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/freaka/32/41962_2.png) [@freaka](https://discuss.elastic.co/u/freaka)\
**Post date:** [April 3, 2019, 3:46pm UTC](https://discuss.elastic.co/t/indexing-a-blob/175211/3 "2019-04-03T15:46:14Z")

</div>

No, I received an object that has some fields that will unpredictably be either a `Value` (String, number...) or an `Object`. I wanted to simply index the object I receive with as few processing as possible but this won't work.  
I found a workaround, the java backend that interacts with elasticsearch now removes every field that could be problematic (as we had a spark of lucidity and prefixed them) before indexing.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 3, 2019, 5:22pm UTC](https://discuss.elastic.co/t/indexing-a-blob/175211/4 "2019-04-03T17:22:35Z")

</div>

But index means that it becomes searchable. Where stored means that it's only stored but can't be use for search.  
So what do you want?

---

<div class="post-metadata">

**Author:** ![freaka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/freaka/32/41962_2.png) [@freaka](https://discuss.elastic.co/u/freaka)\
**Post date:** [April 4, 2019, 7:31am UTC](https://discuss.elastic.co/t/indexing-a-blob/175211/5 "2019-04-04T07:31:10Z")

</div>

I was unaware of this difference until now thanks, so if I want to simply store something I can do it without any mapping? I will just not be able to use it as a filter or a search criteria?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 4, 2019, 12:58pm UTC](https://discuss.elastic.co/t/indexing-a-blob/175211/6 "2019-04-04T12:58:16Z")

</div>

You can use that: [https://www.elastic.co/guide/en/elasticsearch/reference/current/enabled.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/enabled.html)

---

<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:** [May 2, 2019, 12:58pm UTC](https://discuss.elastic.co/t/indexing-a-blob/175211/7 "2019-05-02T12:58:20Z")

</div>

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