There will be many documents like below. I am not indexing the grades field as it will have various numbers of users and can explode the mapping limits. On runtime I want the score to be combination as below
Without indexing , I can get it through _source , but _source lookup is very slow and it is resulting in perfromance bottlenecks
have tried through doc and field lookup, they are fast , but they need ranking.grades fields to be indexed. Down side of this is as the names cannot have any limit, as soon as some 1000 names (mapping default limit) are indexed , the next insertion starts failing.
I am looking for some way where I can access the value without getting it indexed but not at the cost of high latency.
What does your mapping looks like? You may map the grades field as flattened, this will avoid the mapping explosion.
From the documentation:
This data type can be useful for indexing objects with a large or unknown number of unique keys. Only one field mapping is created for the whole JSON object, which can help prevent a mappings explosion from having too many distinct field mappings.