Type conflicts for fields that are not indexed

Hi,

I am quite new to elasticsearch, excuse me if this has been answered before. Could not find the answer in the docs.

I am logging some user-generated data to elasticsearch (browser fingerprint object generated by fingerprint2.js). I have disabled dynamic mapping for the index and only enabled mappings for standardized fields.

The problem is that different browsers may generate slightly different fingerprint structure, which makes elasticsearch throw something like:

mapper_parsing_exception: failed to parse field of type [long] in document with id '...'

Which probably means a type conflict.

Since I have disabled dynamic mapping, I was expecting that elasticsearch would not map and/or index those fields and would not complain about type conflicts.

Is there any way to get elasticsearch accept this data (besides storing entire object in some serialized format)?

thanks

there is an ignore_malformed option in the mapping for a datatype allowing you to ignore such issues (which still means that the field is not searchable).

See https://www.elastic.co/guide/en/elasticsearch/reference/7.5/ignore-malformed.html

Thank you for your answer.

Does getting a type conflict mean that elasticsearch is trying to index the field? I don't have a mapping setup for this field and I have set dynamic mapping to "off" with a hope that only explicitly defined fields would be indexed.

if you have set the dynamic mapping to false and not to strict, that behaviour should occur.

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