Skip to main content

Search

clarifai-nodejs / Exports / Search

Class: Search

Hierarchy

  • Lister

    Search

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Search(«destructured»): Search

Parameters

NameTypeDefault value
«destructured»Objectundefined
› authConfig?AuthConfigundefined
› metric?stringDEFAULT_SEARCH_METRIC
› topK?numberDEFAULT_TOP_K

Returns

Search

Overrides

Lister.constructor

Defined in

client/search.ts:51

Properties

dataProto

Private dataProto: Data

Defined in

client/search.ts:48


inputProto

Private inputProto: Input

Defined in

client/search.ts:49


metricDistance

Private metricDistance: "COSINE_DISTANCE" | "EUCLIDEAN_DISTANCE"

Defined in

client/search.ts:47


topK

Private topK: number

Defined in

client/search.ts:46

Methods

getAnnotProto

getAnnotProto(args): Annotation

Parameters

NameType
argsObject
args.concepts?{ id?: string ; language?: string ; name?: string ; value?: number }[]
args.geoPoint?Object
args.geoPoint.geoLimitnumber
args.geoPoint.latitudenumber
args.geoPoint.longitudenumber
args.imageBytes?unknown
args.imageUrl?string
args.inputDatasetIds?string[]
args.inputStatusCode?number
args.inputTypes?("image" | "text" | "video" | "audio")[]
args.metadata?Record\<string, unknown>
args.textRaw?string

Returns

Annotation

Defined in

client/search.ts:77


getGeoPointProto

getGeoPointProto(longitude, latitude, geoLimit): Geo

Parameters

NameType
longitudenumber
latitudenumber
geoLimitnumber

Returns

Geo

Defined in

client/search.ts:185


getInputProto

getInputProto(args): Input

Parameters

NameType
argsObject
args.concepts?{ id?: string ; language?: string ; name?: string ; value?: number }[]
args.geoPoint?Object
args.geoPoint.geoLimitnumber
args.geoPoint.latitudenumber
args.geoPoint.longitudenumber
args.imageBytes?unknown
args.imageUrl?string
args.inputDatasetIds?string[]
args.inputStatusCode?number
args.inputTypes?("image" | "text" | "video" | "audio")[]
args.metadata?Record\<string, unknown>
args.textRaw?string

Returns

Input

Defined in

client/search.ts:149


listAllPagesGenerator

listAllPagesGenerator\<T>(endpoint, requestData): AsyncGenerator\<AsObject & Record\<"hits", unknown>, void, void>

Type parameters

NameType
Textends PostAnnotationsSearchesRequest | PostInputsSearchesRequest

Parameters

NameType
endpoint(request: T, metadata: Metadata, options: Partial\<CallOptions>) => Promise\<MultiSearchResponse>
requestDataT

Returns

AsyncGenerator\<AsObject & Record\<"hits", unknown>, void, void>

Defined in

client/search.ts:202


query

query(«destructured»): AsyncGenerator\<AsObject & Record\<"hits", unknown>, void, void>

Parameters

NameType
«destructured»Object
› filters?{ concepts?: { id?: string ; language?: string ; name?: string ; value?: number }[] ; geoPoint?: { geoLimit: number ; latitude: number ; longitude: number } ; imageBytes?: unknown ; imageUrl?: string ; inputDatasetIds?: string[] ; inputStatusCode?: number ; inputTypes?: ("image" | "text" | "video" | "audio")[] ; metadata?: Record\<string, unknown> ; textRaw?: string }[]
› ranks?{ concepts?: { id?: string ; language?: string ; name?: string ; value?: number }[] ; geoPoint?: { geoLimit: number ; latitude: number ; longitude: number } ; imageBytes?: unknown ; imageUrl?: string ; inputDatasetIds?: string[] ; inputStatusCode?: number ; inputTypes?: ("image" | "text" | "video" | "audio")[] ; metadata?: Record\<string, unknown> ; textRaw?: string }[]

Returns

AsyncGenerator\<AsObject & Record\<"hits", unknown>, void, void>

Defined in

client/search.ts:259