Knn

February 14, 2026 ยท View on GitHub

Object representing a k-nearest neighbor search query

Properties

NameTypeDescriptionNotes
fieldStringField to perform the k-nearest neighbor search on
kIntegerThe number of nearest neighbors to return
queryKnnQuery[optional]
queryVectorList<BigDecimal>The vector used as input for the KNN search[optional]
docIdLongThe docuemnt ID used as input for the KNN search[optional]
efIntegerOptional parameter controlling the accuracy of the search[optional]
rescoreBooleanOptional parameter enabling KNN rescoring (disabled by default)[optional]
oversamplingBigDecimalOptional parameter setting a factor by which k is multiplied when executing the KNN search[optional]
filterQueryFilter[optional]