UNPKG

weaviate-client

Version:
41 lines (40 loc) • 2.24 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const search_get_js_1 = require("../proto/v1/search_get.js"); const errors_js_1 = require("../errors.js"); const base_js_1 = __importDefault(require("./base.js")); const retry_js_1 = require("./retry.js"); class Searcher extends base_js_1.default { static use(connection, collection, metadata, timeout, consistencyLevel, tenant, abortSignal) { return new Searcher(connection, collection, metadata, timeout, consistencyLevel, tenant, abortSignal); } withFetch = (args) => this.call(search_get_js_1.SearchRequest.fromPartial(args)); withBm25 = (args) => this.call(search_get_js_1.SearchRequest.fromPartial(args)); withHybrid = (args) => this.call(search_get_js_1.SearchRequest.fromPartial(args)); withNearAudio = (args) => this.call(search_get_js_1.SearchRequest.fromPartial(args)); withNearDepth = (args) => this.call(search_get_js_1.SearchRequest.fromPartial(args)); withNearImage = (args) => this.call(search_get_js_1.SearchRequest.fromPartial(args)); withNearIMU = (args) => this.call(search_get_js_1.SearchRequest.fromPartial(args)); withNearObject = (args) => this.call(search_get_js_1.SearchRequest.fromPartial(args)); withNearText = (args) => this.call(search_get_js_1.SearchRequest.fromPartial(args)); withNearThermal = (args) => this.call(search_get_js_1.SearchRequest.fromPartial(args)); withNearVector = (args) => this.call(search_get_js_1.SearchRequest.fromPartial(args)); withNearVideo = (args) => this.call(search_get_js_1.SearchRequest.fromPartial(args)); call = (message) => this.sendWithTimeout((signal) => this.connection.search({ ...message, collection: this.collection, consistencyLevel: this.consistencyLevel, tenant: this.tenant, uses123Api: true, uses125Api: true, uses127Api: true, }, { metadata: this.metadata, signal, ...retry_js_1.retryOptions, }), (err) => new errors_js_1.WeaviateQueryError(err.message, 'gRPC')); } exports.default = Searcher;