Add field with same value for all docs in the index

Hello, I am writing to ask you about a question regarding the correct approach to take in these cases.

We have reports that have a country by default (it is defined when the report is defined) and we have an index that is associated with the report and has a previously defined mapping that is used when the index is created.

I want to start indexing the country within the index and then use it to do aggregations. The issue is that since the country is the same for all the documents, I have some questions that I wanted to ask here:

What would be the best way to add the country since it is always the same for all documents? At the index level? Each index shares the same mapping, but I the country can know it before creating the index.

In case it can be created at the index level, does it support aggregations afterwards? Because finally I'm going to make that field for that.

Thanks in advance!

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