File tree 30 files changed +200
-70
lines changed
30 files changed +200
-70
lines changed Original file line number Diff line number Diff line change @@ -6,12 +6,14 @@ import { getAggRulesITC } from './AggRules';
6
6
7
7
export function getAggBlockITC ( opts : mixed = { } ) : InputTypeComposer {
8
8
const name = getTypeName ( 'AggBlock' , opts ) ;
9
- const description = desc ( `
9
+ const description = desc (
10
+ `
10
11
The aggregations framework helps provide aggregated data based on
11
12
a search query. It is based on simple building blocks called aggregations,
12
13
that can be composed in order to build complex summaries of the data.
13
14
[Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html)
14
- ` ) ;
15
+ `
16
+ ) ;
15
17
16
18
return getOrSetType ( name , ( ) =>
17
19
// $FlowFixMe
@@ -28,6 +30,5 @@ export function getAggBlockITC(opts: mixed = {}): InputTypeComposer {
28
30
description : 'Aggregation rules' ,
29
31
} ,
30
32
} ,
31
- } )
32
- ) ;
33
+ } ) ) ;
33
34
}
Original file line number Diff line number Diff line change 8
8
getDateFormatFC ,
9
9
getDateTimeZoneFC ,
10
10
} from '../../Commons/Date' ;
11
+ import { getDateFields } from '../../Commons/FieldNames' ;
11
12
12
13
export function getDateHistogramITC ( opts : mixed = { } ) : InputTypeComposer {
13
14
const name = getTypeName ( 'AggsDateHistogram' , opts ) ;
@@ -25,12 +26,12 @@ export function getDateHistogramITC(opts: mixed = {}): InputTypeComposer {
25
26
name,
26
27
description,
27
28
fields : {
28
- field : 'String' ,
29
+ field : getDateFields ( opts ) ,
29
30
interval : getDateIntervalFC ( opts ) ,
30
31
time_zone : getDateTimeZoneFC ( opts ) ,
31
32
offset : getDateIntervalFC ( opts ) ,
32
33
format : getDateFormatFC ( opts ) ,
33
- missing : 'Float ' ,
34
+ missing : 'String ' ,
34
35
script : ( ) => getCommonsScriptITC ( opts ) ,
35
36
} ,
36
37
} ) ) ;
Original file line number Diff line number Diff line change 3
3
import { InputTypeComposer } from 'graphql-compose' ;
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
5
import { getDateFormatFC , getDateTimeZoneFC } from '../../Commons/Date' ;
6
+ import { getDateFields } from '../../Commons/FieldNames' ;
6
7
7
8
export function getDateRangeITC ( opts : mixed = { } ) : InputTypeComposer {
8
9
const name = getTypeName ( 'AggsDateRange' , opts ) ;
@@ -24,7 +25,7 @@ export function getDateRangeITC(opts: mixed = {}): InputTypeComposer {
24
25
name,
25
26
description,
26
27
fields : {
27
- field : 'String' ,
28
+ field : getDateFields ( opts ) ,
28
29
format : getDateFormatFC ( opts ) ,
29
30
ranges : ( ) => [ getDateRangeITC ( opts ) ] ,
30
31
time_zone : getDateTimeZoneFC ( opts ) ,
Original file line number Diff line number Diff line change 3
3
import { InputTypeComposer } from 'graphql-compose' ;
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
5
import { getCommonsScriptITC } from '../../Commons/Script' ;
6
+ import { getAllFields } from '../../Commons/FieldNames' ;
6
7
7
8
export function getDiversifiedSamplerITC ( opts : mixed = { } ) : InputTypeComposer {
8
9
const name = getTypeName ( 'AggsDiversifiedSampler' , opts ) ;
@@ -25,7 +26,7 @@ export function getDiversifiedSamplerITC(opts: mixed = {}): InputTypeComposer {
25
26
type : 'String' ,
26
27
defaultValue : 100 ,
27
28
} ,
28
- field : 'String' ,
29
+ field : getAllFields ( opts ) ,
29
30
max_docs_per_value : 'Int' ,
30
31
script : ( ) => getCommonsScriptITC ( opts ) ,
31
32
execution_hint : 'String' ,
Original file line number Diff line number Diff line change 8
8
getDistanceCalculationModeFC ,
9
9
} from '../../Commons/Geo' ;
10
10
import { getFloatRangeITC } from '../../Commons/Float' ;
11
+ import { getGeoPointFields } from '../../Commons/FieldNames' ;
11
12
12
13
export function getGeoDistanceITC ( opts : mixed = { } ) : InputTypeComposer {
13
14
const name = getTypeName ( 'AggsGeoDistance' , opts ) ;
@@ -27,7 +28,7 @@ export function getGeoDistanceITC(opts: mixed = {}): InputTypeComposer {
27
28
name,
28
29
description,
29
30
fields : {
30
- field : 'String' ,
31
+ field : getGeoPointFields ( opts ) ,
31
32
origin : getGeoPointFC ( opts ) ,
32
33
ranges : [ getFloatRangeITC ( opts ) ] ,
33
34
unit : getDistanceUnitFC ( opts ) ,
Original file line number Diff line number Diff line change 2
2
3
3
import { InputTypeComposer } from 'graphql-compose' ;
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
+ import { getGeoPointFields } from '../../Commons/FieldNames' ;
5
6
6
7
export function getGeohashGridITC ( opts : mixed = { } ) : InputTypeComposer {
7
8
const name = getTypeName ( 'AggsGeohashGrid' , opts ) ;
@@ -21,7 +22,7 @@ export function getGeohashGridITC(opts: mixed = {}): InputTypeComposer {
21
22
name,
22
23
description,
23
24
fields : {
24
- field : 'String' ,
25
+ field : getGeoPointFields ( opts ) ,
25
26
precision : 'Int' ,
26
27
size : {
27
28
type : 'Int' ,
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export function getGlobalITC(opts: mixed = {}): InputTypeComposer {
21
21
name,
22
22
description,
23
23
fields : {
24
- without_fields : 'JSON' ,
24
+ _without_fields_ : 'JSON' ,
25
25
} ,
26
26
} ) ) ;
27
27
}
Original file line number Diff line number Diff line change 2
2
3
3
import { InputTypeComposer } from 'graphql-compose' ;
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
+ import { getNumericFields } from '../../Commons/FieldNames' ;
5
6
6
7
export function getHistogramITC ( opts : mixed = { } ) : InputTypeComposer {
7
8
const name = getTypeName ( 'AggsHistogram' , opts ) ;
@@ -20,7 +21,7 @@ export function getHistogramITC(opts: mixed = {}): InputTypeComposer {
20
21
name,
21
22
description,
22
23
fields : {
23
- field : 'String' ,
24
+ field : getNumericFields ( opts ) ,
24
25
interval : 'Float' ,
25
26
missing : 'Float' ,
26
27
min_doc_count : 'Int' ,
Original file line number Diff line number Diff line change 3
3
import { InputTypeComposer } from 'graphql-compose' ;
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
5
import { getIpRangeTypeITC } from '../../Commons/Ip' ;
6
+ import { getIpFields } from '../../Commons/FieldNames' ;
6
7
7
8
export function getIpRangeITC ( opts : mixed = { } ) : InputTypeComposer {
8
9
const name = getTypeName ( 'AggsIpRange' , opts ) ;
@@ -21,7 +22,7 @@ export function getIpRangeITC(opts: mixed = {}): InputTypeComposer {
21
22
name,
22
23
description,
23
24
fields : {
24
- field : 'String' ,
25
+ field : getIpFields ( opts ) ,
25
26
ranges : ( ) => [ getIpRangeTypeITC ( opts ) ] ,
26
27
} ,
27
28
} ) ) ;
Original file line number Diff line number Diff line change 2
2
3
3
import { InputTypeComposer } from 'graphql-compose' ;
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
+ import { getAllFields } from '../../Commons/FieldNames' ;
5
6
6
7
export function getMissingITC ( opts : mixed = { } ) : InputTypeComposer {
7
8
const name = getTypeName ( 'AggsMissing' , opts ) ;
@@ -20,7 +21,7 @@ export function getMissingITC(opts: mixed = {}): InputTypeComposer {
20
21
name,
21
22
description,
22
23
fields : {
23
- field : 'String' ,
24
+ field : getAllFields ( opts ) ,
24
25
} ,
25
26
} ) ) ;
26
27
}
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { InputTypeComposer } from 'graphql-compose';
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
5
import { getFloatRangeKeyedITC } from '../../Commons/Float' ;
6
6
import { getCommonsScriptITC } from '../../Commons/Script' ;
7
+ import { getNumericFields } from '../../Commons/FieldNames' ;
7
8
8
9
export function getRangeITC ( opts : mixed = { } ) : InputTypeComposer {
9
10
const name = getTypeName ( 'AggsRange' , opts ) ;
@@ -23,7 +24,7 @@ export function getRangeITC(opts: mixed = {}): InputTypeComposer {
23
24
name,
24
25
description,
25
26
fields : {
26
- field : 'String' ,
27
+ field : getNumericFields ( opts ) ,
27
28
ranges : ( ) => [ getFloatRangeKeyedITC ( opts ) ] ,
28
29
keyed : 'Boolean' ,
29
30
script : ( ) => getCommonsScriptITC ( opts ) ,
Original file line number Diff line number Diff line change 2
2
3
3
import { InputTypeComposer } from 'graphql-compose' ;
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
+ import { getAllFields } from '../../Commons/FieldNames' ;
5
6
6
7
export function getSignificantTermsITC ( opts : mixed = { } ) : InputTypeComposer {
7
8
const name = getTypeName ( 'AggsSignificantTerms' , opts ) ;
@@ -19,7 +20,7 @@ export function getSignificantTermsITC(opts: mixed = {}): InputTypeComposer {
19
20
name,
20
21
description,
21
22
fields : {
22
- field : 'String' ,
23
+ field : getAllFields ( opts ) ,
23
24
min_doc_count : 'Int' ,
24
25
background_filter : 'JSON' ,
25
26
execution_hint : 'String' ,
Original file line number Diff line number Diff line change 3
3
import { InputTypeComposer } from 'graphql-compose' ;
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
5
import { getCommonsScriptITC } from '../../Commons/Script' ;
6
+ import { getNumericFields } from '../../Commons/FieldNames' ;
6
7
7
8
export function getAvgITC ( opts : mixed = { } ) : InputTypeComposer {
8
9
const name = getTypeName ( 'AggsAvg' , opts ) ;
@@ -22,7 +23,7 @@ export function getAvgITC(opts: mixed = {}): InputTypeComposer {
22
23
name,
23
24
description,
24
25
fields : {
25
- field : 'String' ,
26
+ field : getNumericFields ( opts ) ,
26
27
missing : 'Float' ,
27
28
script : ( ) => getCommonsScriptITC ( opts ) ,
28
29
} ,
Original file line number Diff line number Diff line change 3
3
import { InputTypeComposer } from 'graphql-compose' ;
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
5
import { getCommonsScriptITC } from '../../Commons/Script' ;
6
+ import { getAllFields } from '../../Commons/FieldNames' ;
6
7
7
8
export function getCardinalityITC ( opts : mixed = { } ) : InputTypeComposer {
8
9
const name = getTypeName ( 'AggsCardinality' , opts ) ;
@@ -21,7 +22,7 @@ export function getCardinalityITC(opts: mixed = {}): InputTypeComposer {
21
22
name,
22
23
description,
23
24
fields : {
24
- field : 'String' ,
25
+ field : getAllFields ( opts ) ,
25
26
precision_threshold : {
26
27
type : 'Int' ,
27
28
defaultValue : 3000 ,
Original file line number Diff line number Diff line change 3
3
import { InputTypeComposer } from 'graphql-compose' ;
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
5
import { getCommonsScriptITC } from '../../Commons/Script' ;
6
+ import { getNumericFields } from '../../Commons/FieldNames' ;
6
7
7
8
export function getExtendedStatsITC ( opts : mixed = { } ) : InputTypeComposer {
8
9
const name = getTypeName ( 'AggsExtendedStats' , opts ) ;
@@ -22,7 +23,7 @@ export function getExtendedStatsITC(opts: mixed = {}): InputTypeComposer {
22
23
name,
23
24
description,
24
25
fields : {
25
- field : 'String' ,
26
+ field : getNumericFields ( opts ) ,
26
27
sigma : 'Float' ,
27
28
missing : 'Float' ,
28
29
script : ( ) => getCommonsScriptITC ( opts ) ,
Original file line number Diff line number Diff line change 2
2
3
3
import { InputTypeComposer } from 'graphql-compose' ;
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
+ import { getGeoPointFields } from '../../Commons/FieldNames' ;
5
6
6
7
export function getGeoBoundsITC ( opts : mixed = { } ) : InputTypeComposer {
7
8
const name = getTypeName ( 'AggsGeoBounds' , opts ) ;
@@ -19,7 +20,7 @@ export function getGeoBoundsITC(opts: mixed = {}): InputTypeComposer {
19
20
name,
20
21
description,
21
22
fields : {
22
- field : 'String!' ,
23
+ field : getGeoPointFields ( opts ) ,
23
24
wrap_longitude : 'Boolean' ,
24
25
} ,
25
26
} ) ) ;
Original file line number Diff line number Diff line change 2
2
3
3
import { InputTypeComposer } from 'graphql-compose' ;
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
+ import { getGeoPointFields } from '../../Commons/FieldNames' ;
5
6
6
7
export function getGeoCentroidITC ( opts : mixed = { } ) : InputTypeComposer {
7
8
const name = getTypeName ( 'AggsGeoCentroid' , opts ) ;
@@ -19,7 +20,7 @@ export function getGeoCentroidITC(opts: mixed = {}): InputTypeComposer {
19
20
name,
20
21
description,
21
22
fields : {
22
- field : 'String!' ,
23
+ field : getGeoPointFields ( opts ) ,
23
24
} ,
24
25
} ) ) ;
25
26
}
Original file line number Diff line number Diff line change 3
3
import { InputTypeComposer } from 'graphql-compose' ;
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
5
import { getCommonsScriptITC } from '../../Commons/Script' ;
6
+ import { getNumericFields } from '../../Commons/FieldNames' ;
6
7
7
8
export function getMaxITC ( opts : mixed = { } ) : InputTypeComposer {
8
9
const name = getTypeName ( 'AggsMax' , opts ) ;
9
10
const description = desc (
10
11
`
11
12
A single-value metrics aggregation that keeps track and returns the maximum
12
13
value among the numeric values extracted from the aggregated documents.
13
- These values can be extracted either from specific numeric fields
14
+ These values can be extracted either from specific numeric fields
14
15
in the documents, or be generated by a provided script.
15
16
[Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-max-aggregation.html)
16
17
`
@@ -22,7 +23,7 @@ export function getMaxITC(opts: mixed = {}): InputTypeComposer {
22
23
name,
23
24
description,
24
25
fields : {
25
- field : 'String' ,
26
+ field : getNumericFields ( opts ) ,
26
27
missing : 'Float' ,
27
28
script : ( ) => getCommonsScriptITC ( opts ) ,
28
29
} ,
Original file line number Diff line number Diff line change 3
3
import { InputTypeComposer } from 'graphql-compose' ;
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
5
import { getCommonsScriptITC } from '../../Commons/Script' ;
6
+ import { getNumericFields } from '../../Commons/FieldNames' ;
6
7
7
8
export function getMinITC ( opts : mixed = { } ) : InputTypeComposer {
8
9
const name = getTypeName ( 'AggsMin' , opts ) ;
@@ -22,7 +23,7 @@ export function getMinITC(opts: mixed = {}): InputTypeComposer {
22
23
name,
23
24
description,
24
25
fields : {
25
- field : 'String' ,
26
+ field : getNumericFields ( opts ) ,
26
27
missing : 'Float' ,
27
28
script : ( ) => getCommonsScriptITC ( opts ) ,
28
29
} ,
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { InputTypeComposer } from 'graphql-compose';
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
5
import { getCommonsScriptITC } from '../../Commons/Script' ;
6
6
import { getCommonsHdrITC } from '../../Commons/HDR' ;
7
+ import { getNumericFields } from '../../Commons/FieldNames' ;
7
8
8
9
export function getPercentileRanksITC ( opts : mixed = { } ) : InputTypeComposer {
9
10
const name = getTypeName ( 'AggsPercentileRanks' , opts ) ;
@@ -23,7 +24,7 @@ export function getPercentileRanksITC(opts: mixed = {}): InputTypeComposer {
23
24
name,
24
25
description,
25
26
fields : {
26
- field : 'String' ,
27
+ field : getNumericFields ( opts ) ,
27
28
values : '[Float]' ,
28
29
hdr : ( ) => getCommonsHdrITC ( opts ) ,
29
30
missing : 'Float' ,
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { InputTypeComposer } from 'graphql-compose';
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
5
import { getCommonsScriptITC } from '../../Commons/Script' ;
6
6
import { getCommonsHdrITC } from '../../Commons/HDR' ;
7
+ import { getNumericFields } from '../../Commons/FieldNames' ;
7
8
8
9
export function getPercentilesITC ( opts : mixed = { } ) : InputTypeComposer {
9
10
const name = getTypeName ( 'AggsPercentiles' , opts ) ;
@@ -23,7 +24,7 @@ export function getPercentilesITC(opts: mixed = {}): InputTypeComposer {
23
24
name,
24
25
description,
25
26
fields : {
26
- field : 'String' ,
27
+ field : getNumericFields ( opts ) ,
27
28
percents : '[Float]' ,
28
29
tdigest : `input ${ getTypeName ( 'AggsPercentilesTDigest' , opts ) } {
29
30
compression: Int,
Original file line number Diff line number Diff line change 3
3
import { InputTypeComposer } from 'graphql-compose' ;
4
4
import { getTypeName , getOrSetType , desc } from '../../../utils' ;
5
5
import { getCommonsScriptITC } from '../../Commons/Script' ;
6
+ import { getNumericFields } from '../../Commons/FieldNames' ;
6
7
7
8
export function getStatsITC ( opts : mixed = { } ) : InputTypeComposer {
8
9
const name = getTypeName ( 'AggsStats' , opts ) ;
@@ -22,7 +23,7 @@ export function getStatsITC(opts: mixed = {}): InputTypeComposer {
22
23
name,
23
24
description,
24
25
fields : {
25
- field : 'String' ,
26
+ field : getNumericFields ( opts ) ,
26
27
missing : 'Float' ,
27
28
script : ( ) => getCommonsScriptITC ( opts ) ,
28
29
} ,
You can’t perform that action at this time.
0 commit comments