Now i'm using ElasticSearch 5.3 with groovy script for calculationg of score.
This script use _
doc[field].size() for get count of tokens for field by document.
This logic i'm trying to apply in custom plugin for ElasticSearch 7.7.1.
But i'cant know how can get a tokens for field (with applying a default tokenizer for field) by document.
Also i dont' know how to get field value for document from ElastSearch:
return Apache Lucene Document with two fields: _id and _source.