Indexing a blob


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

        "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 ?


But do you want to search using those fields?

1 Like

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.

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?

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?

You can use that:

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