UNPKG

1.73 kBTypeScriptView Raw
1/**
2 * Provides the ability to specify sorting for a search query.
3 *
4 * @category Full Text Search
5 */
6export declare class SearchSort {
7 protected _data: any;
8 constructor(data: any);
9 toJSON(): any;
10 static score(): ScoreSearchSort;
11 static id(): IdSearchSort;
12 static field(field: string): FieldSearchSort;
13 static geoDistance(field: string, lat: number, lon: number): GeoDistanceSearchSort;
14}
15/**
16 * Provides sorting for a search query by score.
17 *
18 * @category Full Text Search
19 */
20export declare class ScoreSearchSort extends SearchSort {
21 /**
22 * @internal
23 */
24 constructor();
25 descending(descending: boolean): ScoreSearchSort;
26}
27/**
28 * Provides sorting for a search query by document id.
29 *
30 * @category Full Text Search
31 */
32export declare class IdSearchSort extends SearchSort {
33 /**
34 * @internal
35 */
36 constructor();
37 descending(descending: boolean): IdSearchSort;
38}
39/**
40 * Provides sorting for a search query by a specified field.
41 *
42 * @category Full Text Search
43 */
44export declare class FieldSearchSort extends SearchSort {
45 /**
46 * @internal
47 */
48 constructor(field: string);
49 type(type: string): FieldSearchSort;
50 mode(mode: string): FieldSearchSort;
51 missing(missing: boolean): FieldSearchSort;
52 descending(descending: boolean): FieldSearchSort;
53}
54/**
55 * Provides sorting for a search query by geographic distance from a point.
56 *
57 * @category Full Text Search
58 */
59export declare class GeoDistanceSearchSort extends SearchSort {
60 /**
61 * @internal
62 */
63 constructor(field: string, lat: number, lon: number);
64 unit(unit: string): GeoDistanceSearchSort;
65 descending(descending: boolean): GeoDistanceSearchSort;
66}