Function
Static Public Summary | ||
public |
allFilters(filters: Filter[]): Filter Creates an All Filter. |
|
public |
anyFilters(filters: Filter[]): Filter Creates an Any Filter. |
|
public |
Creates a body object |
|
public |
Creates a Bucket object. |
|
public |
bucketAggregate(name: string, buckets: bucket[]): Aggregate Creates a Bucket Aggregate Object. |
|
public |
countAggregate(name: string, field: Field): Aggregate Creates a Count Aggregate Object. |
|
public |
elementFieldBoost(field: Field, elts: string[]): FieldBoost Creates an Element Field Boost. |
|
public |
featureFieldBoost(field_boost: FieldBoost, value: number): FeatureFieldBoost Creates a FeatureFieldBoost from a FieldBoost |
|
public |
fieldFilter(field: Field, operator: string, values: *): Filter Create a Field Filter. |
|
public |
fieldInstanceBoost(field: Field, value: number): InstanceBoost Creates a Field Instance Boost. |
|
public |
filterFieldBoost(filter: Filter, value: number): FieldBoost Creates a Filter Field Boost. |
|
public |
geoFilter(field_lat: Field, field_lng: Field, lat: number, lng: number, radius: radius, region: GeoRegion): Filter Creates a Geo Filter. |
|
public |
intervalFieldBoost(field: Field, points: PointValue[]): FieldBoost Creates an Interval Field Boost. |
|
public |
metricAggregate(name: string, field: Field, type: MetricType): Aggregate Creates a Metric Aggregate Object. |
|
public |
noneOfFilters(filters: Filter[]): Filter Creates a None Of Filter. |
|
public |
oneOfFilters(filters: Filter[]): Filter Creates a One Of Filter. |
|
public |
pipeline(name: *, values: *, tracking: *): {"pipeline": *, "values": *, "tracking": *} |
|
public |
pointValue(point: number, value: number): PointValue Creates a Point Value for use in an Interval Field Boost. |
|
public |
scoreInstanceBoost(threshold: number, minCount: number): InstanceBoost Creates a Score Instance Boost. |
|
public |
Creates a Sort object. |
|
public |
textFieldBoost(field: Field, text: string): FieldBoost TextFieldBoost represents a text-based boosting for string fields. |
Static Public
public allFilters(filters: Filter[]): Filter source
import {allFilters} from 'sajari/src/sajari.js'
Creates an All Filter. An All filter will resolve to True only if all it's child filters resolve to True.
Params:
Name | Type | Attribute | Description |
filters | Filter[] | The child filters. |
public anyFilters(filters: Filter[]): Filter source
import {anyFilters} from 'sajari/src/sajari.js'
Creates an Any Filter. An Any filter will resolve to True if at least one of it's child filters resolve to True.
Params:
Name | Type | Attribute | Description |
filters | Filter[] | The child filters. |
public body(text: string, weight: number): Body source
import {body} from 'sajari/src/sajari.js'
Creates a body object
public bucket(name: string, filter: Filter): Bucket source
import {bucket} from 'sajari/src/sajari.js'
Creates a Bucket object.
public bucketAggregate(name: string, buckets: bucket[]): Aggregate source
import {bucketAggregate} from 'sajari/src/sajari.js'
Creates a Bucket Aggregate Object.
public countAggregate(name: string, field: Field): Aggregate source
import {countAggregate} from 'sajari/src/sajari.js'
Creates a Count Aggregate Object.
public elementFieldBoost(field: Field, elts: string[]): FieldBoost source
import {elementFieldBoost} from 'sajari/src/sajari.js'
Creates an Element Field Boost. ElementFieldBoost represents an element-based boosting for repeated field values. The resulting boost is the proportion of elements in elts that are also in the field value.
public featureFieldBoost(field_boost: FieldBoost, value: number): FeatureFieldBoost source
import {featureFieldBoost} from 'sajari/src/sajari.js'
Creates a FeatureFieldBoost from a FieldBoost
Params:
Name | Type | Attribute | Description |
field_boost | FieldBoost | ||
value | number |
public fieldFilter(field: Field, operator: string, values: *): Filter source
import {fieldFilter} from 'sajari/src/sajari.js'
Create a Field Filter.
Operator | Description |
---|---|
= |
Equal to |
!= |
Not equal to |
> |
Greater than |
>= |
Greater than or equal to |
< |
Less than |
<= |
Less than or equal to |
~ |
Contains |
!~ |
Does not contain |
^ |
Has prefix |
$ |
Has suffix |
public fieldInstanceBoost(field: Field, value: number): InstanceBoost source
import {fieldInstanceBoost} from 'sajari/src/sajari.js'
Creates a Field Instance Boost. FilterFieldBoost is a boost which is applied to documents which satisfy the filter. Value must be greater than 0. Documents which match the filter will receive a boost of Value.
public filterFieldBoost(filter: Filter, value: number): FieldBoost source
import {filterFieldBoost} from 'sajari/src/sajari.js'
Creates a Filter Field Boost. FilterFieldBoost is a boost which is applied to documents which satisfy the filter. Value must be greater than 0. Documents which match the filter will receive a boost of Value
public geoFilter(field_lat: Field, field_lng: Field, lat: number, lng: number, radius: radius, region: GeoRegion): Filter source
import {geoFilter} from 'sajari/src/sajari.js'
Creates a Geo Filter.
Params:
Name | Type | Attribute | Description |
field_lat | Field | The field containing the latitude value. |
|
field_lng | Field | The field containing the longitude value. |
|
lat | number | The latitude to compare against. |
|
lng | number | The longitude to compare against. |
|
radius | radius | The radius to restrict the filter to. |
|
region | GeoRegion | The region to restrict the filter to. |
public intervalFieldBoost(field: Field, points: PointValue[]): FieldBoost source
import {intervalFieldBoost} from 'sajari/src/sajari.js'
Creates an Interval Field Boost. IntervalFieldBoost represents an interval-based boost for numeric field values. An interval field boost is defined by a list of points with corresponding boost values. When a field value falls between between two PointValues.Point values is computed linearly.
Params:
Name | Type | Attribute | Description |
field | Field | The field to boost. |
|
points | PointValue[] | The points to use as intervals. |
public metricAggregate(name: string, field: Field, type: MetricType): Aggregate source
import {metricAggregate} from 'sajari/src/sajari.js'
Creates a Metric Aggregate Object.
Params:
Name | Type | Attribute | Description |
name | string | The name of the aggregate. |
|
field | Field | The field to aggregate. |
|
type | MetricType | The type of metric to gather. |
public noneOfFilters(filters: Filter[]): Filter source
import {noneOfFilters} from 'sajari/src/sajari.js'
Creates a None Of Filter. A None Of filter will resolve to True only if none of it's child filters resolve to True.
Params:
Name | Type | Attribute | Description |
filters | Filter[] | The child filters. |
public oneOfFilters(filters: Filter[]): Filter source
import {oneOfFilters} from 'sajari/src/sajari.js'
Creates a One Of Filter. A One Of filter will resolve to True only if exactly one of it's child filters resolve to True.
Params:
Name | Type | Attribute | Description |
filters | Filter[] | The child filters. |
public pipeline(name: *, values: *, tracking: *): {"pipeline": *, "values": *, "tracking": *} source
import {pipeline} from 'sajari/src/sajari.js'
Params:
Name | Type | Attribute | Description |
name | * | ||
values | * | ||
tracking | * |
Return:
{"pipeline": *, "values": *, "tracking": *} |
public pointValue(point: number, value: number): PointValue source
import {pointValue} from 'sajari/src/sajari.js'
Creates a Point Value for use in an Interval Field Boost.
public scoreInstanceBoost(threshold: number, minCount: number): InstanceBoost source
import {scoreInstanceBoost} from 'sajari/src/sajari.js'
Creates a Score Instance Boost. ScoreInstanceBoost is a boost applied to index terms which have interaction data set. For an instance score boost to take effect, the instance must have received at least minCount score updates (i.e. count). If an item is performing as it should then its score will be 1. If the score is below threshold (0 < threshold < 1) then the score will be applied.
public sort(field: Field): Sort source
import {sort} from 'sajari/src/sajari.js'
Creates a Sort object. Sort defines a sort order for a query.
Params:
Name | Type | Attribute | Description |
field | Field | The field to sort by, prepended by |
public textFieldBoost(field: Field, text: string): FieldBoost source
import {textFieldBoost} from 'sajari/src/sajari.js'
TextFieldBoost represents a text-based boosting for string fields. It compares the text gainst the document field using a bag-of-words model.