@ekodb/ekodb-client 0.15.1 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.js CHANGED
@@ -1720,7 +1720,10 @@ class EkoDBClient {
1720
1720
  limit,
1721
1721
  };
1722
1722
  const response = await this.search(collection, searchQuery);
1723
- return response.results.map((r) => r.record);
1723
+ return response.results.map((r) => ({
1724
+ ...r.record,
1725
+ _score: r.score,
1726
+ }));
1724
1727
  }
1725
1728
  /**
1726
1729
  * Find all records in a collection with a limit
@@ -1944,6 +1944,7 @@ function mockErrorResponse(status, message) {
1944
1944
  (0, vitest_1.expect)(result).toHaveLength(1);
1945
1945
  (0, vitest_1.expect)(result[0]).toHaveProperty("id", "doc_1");
1946
1946
  (0, vitest_1.expect)(result[0]).toHaveProperty("title", "ML Guide");
1947
+ (0, vitest_1.expect)(result[0]).toHaveProperty("_score", 0.95);
1947
1948
  });
1948
1949
  });
1949
1950
  // ============================================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekodb/ekodb-client",
3
- "version": "0.15.1",
3
+ "version": "0.15.2",
4
4
  "description": "Official TypeScript/JavaScript client for ekoDB",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -2584,6 +2584,7 @@ describe("EkoDBClient text and hybrid search", () => {
2584
2584
  expect(result).toHaveLength(1);
2585
2585
  expect(result[0]).toHaveProperty("id", "doc_1");
2586
2586
  expect(result[0]).toHaveProperty("title", "ML Guide");
2587
+ expect(result[0]).toHaveProperty("_score", 0.95);
2587
2588
  });
2588
2589
  });
2589
2590
 
package/src/client.ts CHANGED
@@ -2912,7 +2912,10 @@ export class EkoDBClient {
2912
2912
  };
2913
2913
 
2914
2914
  const response = await this.search(collection, searchQuery);
2915
- return response.results.map((r) => r.record);
2915
+ return response.results.map((r) => ({
2916
+ ...r.record,
2917
+ _score: r.score,
2918
+ }));
2916
2919
  }
2917
2920
 
2918
2921
  /**