Can I store the json without creating a mapping

now , I save json use nested type , but create many mapping , I'm not going to use the json data for searching, is there a way to store the json without creating a mapping?

The json I'm depositing is changing, so it's causing a long, long mapping. about 50-100 mapping,or more . That doesn't seem to be the correct usage.

I am also a noob with Elasticsearch and had the same question when I had just started. You don't absolutely need to create mapping before inserting JSON to an index as ES will try to understand your data and create mapping dynamically. You can add/remove fields but updates to a field type will be difficult to manage.

When inserting your json data try not to have everything as strings. For example - if you have integers then pass them as integers (dont add double quotes around them). ES will save them as number type. Same thing with dates - if your date isn't in the ES's default date format then you can set custom date format using mapping. Again, you don't need to define mapping for everything but if there is a field that you would like to be interpreted in a certain way, then you should set mapping and format accordingly.

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