@vectorstores/elastic-search 0.1.3 → 0.1.4

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/index.cjs CHANGED
@@ -261,6 +261,17 @@ function getElasticSearchClient({ esUrl, esCloudId, esApiKey, esUsername, esPass
261
261
  ids: topKIDs
262
262
  };
263
263
  }
264
+ async exists(refDocId) {
265
+ const result = await this.elasticSearchClient.count({
266
+ index: this.indexName,
267
+ query: {
268
+ term: {
269
+ "metadata.ref_doc_id": refDocId
270
+ }
271
+ }
272
+ });
273
+ return result.count > 0;
274
+ }
264
275
  }
265
276
 
266
277
  exports.ElasticSearchVectorStore = ElasticSearchVectorStore;
package/dist/index.d.cts CHANGED
@@ -92,6 +92,7 @@ declare class ElasticSearchVectorStore extends BaseVectorStore {
92
92
  * @private
93
93
  */
94
94
  private getVectorSearchQueryResultFromResponse;
95
+ exists(refDocId: string): Promise<boolean>;
95
96
  }
96
97
 
97
98
  export { ElasticSearchVectorStore };
package/dist/index.d.ts CHANGED
@@ -92,6 +92,7 @@ declare class ElasticSearchVectorStore extends BaseVectorStore {
92
92
  * @private
93
93
  */
94
94
  private getVectorSearchQueryResultFromResponse;
95
+ exists(refDocId: string): Promise<boolean>;
95
96
  }
96
97
 
97
98
  export { ElasticSearchVectorStore };
@@ -92,6 +92,7 @@ declare class ElasticSearchVectorStore extends BaseVectorStore {
92
92
  * @private
93
93
  */
94
94
  private getVectorSearchQueryResultFromResponse;
95
+ exists(refDocId: string): Promise<boolean>;
95
96
  }
96
97
 
97
98
  export { ElasticSearchVectorStore };
@@ -259,6 +259,17 @@ function getElasticSearchClient({ esUrl, esCloudId, esApiKey, esUsername, esPass
259
259
  ids: topKIDs
260
260
  };
261
261
  }
262
+ async exists(refDocId) {
263
+ const result = await this.elasticSearchClient.count({
264
+ index: this.indexName,
265
+ query: {
266
+ term: {
267
+ "metadata.ref_doc_id": refDocId
268
+ }
269
+ }
270
+ });
271
+ return result.count > 0;
272
+ }
262
273
  }
263
274
 
264
275
  export { ElasticSearchVectorStore };
package/dist/index.js CHANGED
@@ -259,6 +259,17 @@ function getElasticSearchClient({ esUrl, esCloudId, esApiKey, esUsername, esPass
259
259
  ids: topKIDs
260
260
  };
261
261
  }
262
+ async exists(refDocId) {
263
+ const result = await this.elasticSearchClient.count({
264
+ index: this.indexName,
265
+ query: {
266
+ term: {
267
+ "metadata.ref_doc_id": refDocId
268
+ }
269
+ }
270
+ });
271
+ return result.count > 0;
272
+ }
262
273
  }
263
274
 
264
275
  export { ElasticSearchVectorStore };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vectorstores/elastic-search",
3
3
  "description": "Elastic Search Storage for vectorstores",
4
- "version": "0.1.3",
4
+ "version": "0.1.4",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
@@ -35,11 +35,11 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "vitest": "^3.0.9",
38
- "@vectorstores/core": "0.1.3",
38
+ "@vectorstores/core": "0.1.4",
39
39
  "@vectorstores/env": "0.1.0"
40
40
  },
41
41
  "peerDependencies": {
42
- "@vectorstores/core": "0.1.3",
42
+ "@vectorstores/core": "0.1.4",
43
43
  "@vectorstores/env": "0.1.0"
44
44
  },
45
45
  "dependencies": {