aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/framework/src/models/elasticSearch.ts
blob: 7c12f97d3ab099e3d631c637c4c7b437a0d28bfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
export type Result<TSource extends {}> = {
  took: number;
  timed_out: boolean;
  _shards: {
    total: number;
    successful: number;
    failed: number;
  };
  hits: {
    total: number;
    max_score: number;
    hits?: (HitEntry<TSource>)[] | null;
  };
}

export type HitEntry<TSource extends {}> = {
  _index: string;
  _type: string;
  _id: string;
  _score: number;
  _source: TSource;
}

type ActionResponse ={
  _index: string;
  _type: string;
  _id: string;
  _shards: {
    total: number,
    successful: number,
    failed: number
    },
   
}

export type PostResponse = ActionResponse & {
  created: boolean
}

export type DeleteResponse = ActionResponse & {
  found: boolean
}