k-NN Painless Scripting extensions
To use k-NN’s Painless Scripting functions, first create an index with knn_vector
fields like in . Once the index is created and you ingest some data, you can use the painless extensions:
The following table describes the available painless functions the k-NN plugin provides:
If a vector field doesn’t have a value, the function throws an .
Because scores can only be positive, this script ranks documents with vector fields higher than those without.