Home Reference Source
import {Client} from 'sajari/src/sajari.js'
public class | source

Client

Class representing an instance of the Client. Handles the searching of queries and keeping track of query id and sequence

Constructor Summary

Public Constructor
public

constructor(project: string, collection: string, endpoint: string): Client

Creates an Client object.

Member Summary

Private Members
private

c: *

private

e: *

private

p: *

Method Summary

Public Methods
public

search(query: Query, tracking: Tracking, callback: function(err: string, res: Object)): XMLHttpRequest

Performs a search

public

searchPipeline(name: string, values: Object, tracking: Tracking, callback: function(err: string, res: Object)): XMLHttpRequest

Performs a search using a pipeline.

Public Constructors

public constructor(project: string, collection: string, endpoint: string): Client source

Creates an Client object.

Params:

NameTypeAttributeDescription
project string

The project name.

collection string

The collection name.

endpoint string
  • optional

A custom endpoint to send requests.

Return:

Client

Client object.

Private Members

private c: * source

private e: * source

private p: * source

Public Methods

Performs a search

Params:

NameTypeAttributeDescription
query Query

The query object to perform a search with.

tracking Tracking

The tracking config for the search.

callback function(err: string, res: Object)

The callback to call when a response is received.

Return:

XMLHttpRequest

public searchPipeline(name: string, values: Object, tracking: Tracking, callback: function(err: string, res: Object)): XMLHttpRequest source

Performs a search using a pipeline.

Params:

NameTypeAttributeDescription
name string

The name of the pipeline to search with.

values Object

Value map for the pipeline.

tracking Tracking

The tracking config for the search.

callback function(err: string, res: Object)

The callback to call when a response is received.

Return:

XMLHttpRequest