Hi,
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.
i'm using https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting-engine.html for example
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:
context.reader().document(docId)
return Apache Lucene Document with two fields: _id and _source.