From the doc above, I understand we can add new fields to the current mapping by just providing the fieldname and the properties of that field.
However I’m wondering, is it possible, or is opensearch smart enough under the hood to take in the current mappings with new fields added. I can see from the console that the new fields are added, but does the existing fields get touched in this process or do they get skipped?
I can see from the errors that it does complain when an existing field is being modified. But I’m wondering if existing fields are getting updated with this command and would they need reindexing.
I do not entirely understand your question but will try to share how things work in general. So yes, you could add a new property to the existing index mapping. For newly ingested documents the property is going to be populated but the existing documents have to be backfilled manually. For existing mapping properties, you could only do very limited set of modifications - the ones that do not require reindexing, otherwise the modification will be rejected. For the same reasons, you cannot remove fields from the existing mappings. Also, when you add new field to the mappings, the existing fields are not affected anyhow. Hope it helps.
@gsitu322 Oh I see, yes, you should be able to resend the the existing fields with the new fields included, assuming there no breaking changes to existing fields in the mapping (in other words, if existing fields stay unchanged - not an issue).