Completely remove mapping check

I'm using ES8+ to store a lot of different document, but I've encountered some problems with property mapping. I am working with documents, each of which has hundreds of different fields, many of them with the same name.Having to follow the directives of an Government agency, sometimes fields with the same name can have different values.

For example, the field named OGT is sometimes a string, other times it can be the parent of other fields: OGT: { OGTD: '', OGTN:''}, other times it can be a repeatable field, and thus an array of strings or other sub-objects.

I also tried to put all these properties inside a _source Array, to avoid mapping, but nothing changes.

Having to adhere to these directives, which decided to keep the same name for these occurrences, I thought about adding and removing an underscore followed by a random string to solve the problem, but in that case it would be difficult for me to use search functions - unless always using full-text ones.

I haven't yet tried searching using regex, but before proceeding or moving everything in favor of mongodb, I'd like to know if it is possible to definitively eliminate the mapping check from Elasticsearch.

It is not.

"OTG" at different document level can have different "type". That's not the issue.
Will the same "OTG" at the same json level switch the "type" say between string and structure?

If the answer is yes, you can't save the document as is directly to ES. You have to have a translation layer to convert.

If it's simply different native types (like string, integer, float, boolean, etc), then you can simply store as string cuz simple types can simply be written out as string. If it could be another json struct, then you are out of luck with ES.

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