Open busma13 opened 4 weeks ago
I made a test repo that uses "@opensearch-project/opensearch": "2.12.0" js client to make an index in opensearch2 using the same mapping as in teraslice and dynamic: false is added properly.
I am thinking there is possibly a setting on the client we create that is overriding the dynamic setting.
I've finally found the code that modifies the mapping to remove the dynamic
property.
packages/elasticsearch-store/src/elasticsearch-client/method-helpers/helper-utils.ts
ensureNoTypeInMapping()
removes the type, but fails to copy over any fields besides properties
and _meta
.
To modify this function properly we need to know all the possible keys within a mapping that are not a type
because we are selectively only copying those keys. So far I have properties, _meta, and dynamic. _all
seems to get removed before this function is called, and it is not valid in OS2 or ES8 (the two cases where this function is called), so we wouldn't want to copy it if it was there. Does anyone know of any other possibilities? @godber @lesleydreyer @jsnoble
I can't think of anything other than the ones you found - properties/_meta/dynamic
When indices for the teraslice state storage are created we pass in mappings that include
dynamic: false
. job mapping:In opensearch2 the resulting indices do not have the dynamic field set to false. Also notice that the job key is replaced by
_doc
. opensearch1 result:opensearch2 result: