How to handle inconsistent field types

I am trying to index a JSON object (comes from Postgres) that has sometimes-inconsistent types that is tripping me up.

an example would be:

{
    "financials": {
        "amount": "100"
    }
},
{
    "financials": {
        "amount": "25.20"
    }
},

There are (unfortunately!) multiple fields like this. Is there a way I can set a sort of global flag to "treat it all as text"? It's tripping up on int vs. long, etc.

You can force the mapping to have this field as a text.

Or keyword

gotcha! thanks for the ideas here, I will try probably text first, since I see that still allows full text search, vs. keyword type.

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