Can I customize the inverted index to achieve cosine similarity?

I want to storage the pairs of keyword and weight of a aticle instead of the full text inelastic search.The document's format is in elasticsearch as follows:
{title:"XXX",keyWords:{{"keyword1":value1},{"keyword2":value2},{"keyword3":value3}.....} .
The query's format is as follws:
{{"query1":value1},{"query2":value2},.....}.
I want to replace the elasticsearch scoring mechanism with cosine similarity.But there is one question:If I am not based on inverted index to replace the scoring mechanism,then the calculation is heavy.So I want to know whether I can to customize the inverted index that make the keyword's value storage in the inverted index.
What should I do?
Thanks!

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