Skip to content

Commit

Permalink
Update src/core/knn.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-suhas authored Mar 20, 2024
1 parent 037a1e5 commit f648f0b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/core/knn.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),

Check failure on line 92 in src/core/knn.js

View workflow job for this annotation

GitHub Actions / check (10.x)

Delete `·`

Check failure on line 92 in src/core/knn.js

View workflow job for this annotation

GitHub Actions / check (12.x)

Delete `·`
* new esb.TermQuery('field2', 'value2')
* ]); // Applying multiple filter queries
*/
filter(queries) {
const queryArray = Array.isArray(queries) ? queries : [queries];
Expand Down

0 comments on commit f648f0b

Please sign in to comment.