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

Query

Class representing a Query.

Constructor Summary

Public Constructor
public

Creates a Query object.

Member Summary

Private Members
private

q: {"limit": number}

Method Summary

Public Methods
public

aggregates(aggregates: Aggregate[])

Sets the Aggregates on a query.

public

Applies the FeatureQuery to the Query

public

fields(fields: Field[])

Sets a list of Fields to be returned.

public

filter(filter: Filter)

Sets a Filter for the Query.

public

Applies the IndexQuery to the Query

public

limit(limit: number)

Sets the limit on the Query.

public

offset(offset: number)

Sets the offset on the Query.

public

sort(sorts: Sort[])

Sets the Sorts on a Query.

public

transforms(transforms: Transform[])

Sets the Transforms on a Query.

Public Constructors

public constructor(): Object source

Creates a Query object.

Return:

Object

Query object.

Private Members

private q: {"limit": number} source

Public Methods

public aggregates(aggregates: Aggregate[]) source

Sets the Aggregates on a query. Aggregates is a set of Aggregates to run against a result set.

Params:

NameTypeAttributeDescription
aggregates Aggregate[]

The list of Aggregates.

public featureQuery(query: FeatureQuery) source

Applies the FeatureQuery to the Query

Params:

NameTypeAttributeDescription
query FeatureQuery

public fields(fields: Field[]) source

Sets a list of Fields to be returned.

Params:

NameTypeAttributeDescription
fields Field[]

The Fields to be returned from a search.

public filter(filter: Filter) source

Sets a Filter for the Query.

Params:

NameTypeAttributeDescription
filter Filter

The Filter to be applied to the Query.

public indexQuery(query: IndexQuery) source

Applies the IndexQuery to the Query

Params:

NameTypeAttributeDescription
query IndexQuery

public limit(limit: number) source

Sets the limit on the Query. This determines the maximum number of results each search will return.

Params:

NameTypeAttributeDescription
limit number

The maximum number of results to return per search.

public offset(offset: number) source

Sets the offset on the Query.

Params:

NameTypeAttributeDescription
offset number

The offset to use.

public sort(sorts: Sort[]) source

Sets the Sorts on a Query.

Params:

NameTypeAttributeDescription
sorts Sort[]

The Sorts to be applied in order to the Query.

public transforms(transforms: Transform[]) source

Sets the Transforms on a Query.

Params:

NameTypeAttributeDescription
transforms Transform[]

The Transforms to be applied to the Query.