From f648f0b59ec5db023442c8b0c3835ddcfddce500 Mon Sep 17 00:00:00 2001 From: Suhas Karanth Date: Wed, 20 Mar 2024 16:44:37 +0530 Subject: [PATCH] Update src/core/knn.js --- src/core/knn.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/core/knn.js b/src/core/knn.js index b3a736b..854e92e 100644 --- a/src/core/knn.js +++ b/src/core/knn.js @@ -84,10 +84,14 @@ class KNN { * @returns {KNN} Returns `this` to allow method chaining. * @throws {TypeError} If any of the provided queries is not an instance of `Query`. * - * Usage example: - * let knn = new KNN(); - * knn.filter(new TermQuery('field', 'value')); // Applying a single filter query - * knn.filter([new TermQuery('field1', 'value1'), new TermQuery('field2', 'value2')]); // Applying multiple filter queries + * @example + * let knn = new esb.KNN().filter(new esb.TermQuery('field', 'value')); // Applying a single filter query + * + * @example + * let knn = new esb.KNN().filter([ + * new esb.TermQuery('field1', 'value1'), + * new esb.TermQuery('field2', 'value2') + * ]); // Applying multiple filter queries */ filter(queries) { const queryArray = Array.isArray(queries) ? queries : [queries];