Compute similarty score while ingesting data


I have a pipeline which contains :

  • a file parser that embedds some text fileds in vectors
  • an elasticsearch ingest pipeline that process additionnel transformations on other numerical/date fields

I’d like to use Knn for a classification use case. i.e. computing the similarity score of each embedded vector against a set of labelised vectors and adding a label to this vector.

Is it possible to do this using some script processor in ingest pipeline ?