How to get keywords' tf-idf score across an index?


I wonder is there a way to get IDF score of some keywords across an index?

for example, let us imagine an index which 100 docs indexed.

Now I have keyword set extracted from sentence something like "computer, engineering, database, optimizing, btree".

then I want to calculate which keyword is most adoptable tag of that sentance.
for example : btree 0.9 , database 0.5

is this possible in elasticsearch?
or could you please advice any alternatives?

i know I can query by each keyword then get the result count.
but it is inefficient if keyword set's size is large.