Currently, we are indexing information on elastic for each business that is our customer (B2B), this is causing us to have too many indexes, some with very small shards (500mb shards)
But due to the nature of the data, we can have a lot of type collision on the fields, for example
Company_A, has the following:
{
"id": "8f22efb2-6a2a-4cb7-9d0b-01ca0d6cff2e",
"notes" : {
"created_at": "2022/01/01",
"value": "This is some random note"
} ,
"first_name": "Some name",
"integration": "CRM_A"
}
While Company_B will have:
{
"id": 1,
"notes": "This is a random note text",
"name": "Some random name",
"integration": "CRM_A"
}
What we were thinking is to have them on a single index, by "integration", but on this case, they would both have different types for the field called notes
, where one has a object, another one has text, this also happens on a lot of other fields, basically multiple cases of the same field name with different types
Is there any way to solve this with elastic?
If we can have a way, we would finally be able to have our shards with 20-30gb of data, as is recommended, instead of having TONS of small shards, forcing us to have way more memory to keep all the mappings and everything in place.
One thing we considered was to add the type to the name of the fields, and remove them prior to returning the response, but that might takes really confusing