Hello, I'd like to ask a question about field caching on fields not
present on all documents.
We maintain a flat index with documents belonging to different
categories, our documents are like this
{
name: "Document name",
category_id: 42,
filters: {
fg_10: [10,20,30,40],
fg_11: [100, 200, 300, 400]
}
}
- Each document, depending on its category_id, has different filter
keys, for example documents with category_id = 42 have:
filters: {
fg_10: [],
fg_11: []
}
where documents with category_id = 25 have:
filters: {
fg_20: [],
fg_21: []
}
One of our two main queries is a term filtered query for a specific
category, with faceting on that category fg_* keys (filters.fg_10,
filters.fg_11)
According to what I have read, elastic keeps a field cache for
each faceted field, so in our case there should be a field cache for
fg_10, fg_11, fg_20, fg_21)
I'd like to know how space-efficient the field cache for our setup is.
For example, is the field cache for fg_10 "smart" enough to only
include documents for category_id=40 or it includes all index
documents taking more space?