mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-19 16:13:06 +00:00
refactor: mapping generation for `Elasticsearch 8.4
This commit is contained in:
committed by
Rainer Killinger
parent
08ec4e4381
commit
61fee2bbf3
@@ -14,17 +14,18 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
*/
|
||||
export interface AnyUnknown {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
foo: any;
|
||||
|
||||
bar: unknown;
|
||||
|
||||
type: ThingType.AnyUnknown
|
||||
type: ThingType.AnyUnknown;
|
||||
}
|
||||
|
||||
export const testConfig: MapAggTestOptions = {
|
||||
@@ -34,12 +35,12 @@ export const testConfig: MapAggTestOptions = {
|
||||
maps: {
|
||||
foo: {
|
||||
dynamic: true,
|
||||
properties: {}
|
||||
properties: {},
|
||||
},
|
||||
bar: {
|
||||
dynamic: true,
|
||||
properties: {}
|
||||
}
|
||||
}
|
||||
}
|
||||
properties: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
* @date
|
||||
*/
|
||||
export type SCISO8601Date = string
|
||||
export type SCISO8601Date = string;
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
@@ -33,7 +33,7 @@ export interface DateAndRange {
|
||||
|
||||
dateAlias: SCISO8601Date;
|
||||
|
||||
type: ThingType.Date
|
||||
type: ThingType.Date;
|
||||
}
|
||||
|
||||
export const testConfig: MapAggTestOptions = {
|
||||
@@ -47,6 +47,6 @@ export const testConfig: MapAggTestOptions = {
|
||||
dateAlias: {
|
||||
type: ElasticsearchDataType.date,
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
@@ -39,13 +39,11 @@ export const testConfig: MapAggTestOptions = {
|
||||
dynamic: 'strict',
|
||||
properties: {
|
||||
bar: {
|
||||
type: ElasticsearchDataType.parse_error
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.parse_error,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
err: [
|
||||
`At "${ThingType.DefaultGeneric}::foo.bar" for Generic "T": Missing reflection, please report!`
|
||||
]
|
||||
err: [`At "${ThingType.DefaultGeneric}::foo.bar" for Generic "T": Missing reflection, please report!`],
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
@@ -42,15 +42,15 @@ export const testConfig: MapAggTestOptions = {
|
||||
map: {
|
||||
maps: {
|
||||
stringDoubleTypeConflict: {
|
||||
type: ElasticsearchDataType.type_conflict
|
||||
type: ElasticsearchDataType.type_conflict,
|
||||
},
|
||||
numberDoubleTypeConflict: {
|
||||
type: ElasticsearchDataType.type_conflict
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.type_conflict,
|
||||
},
|
||||
},
|
||||
},
|
||||
err: [
|
||||
`At "${ThingType.DoubleTypeConflict}::stringDoubleTypeConflict" for type "string": Type conflict; "keyword" would override "text"`,
|
||||
`At "${ThingType.DoubleTypeConflict}::numberDoubleTypeConflict" for type "number": Type conflict; "integer" would override "float"`
|
||||
]
|
||||
`At "${ThingType.DoubleTypeConflict}::numberDoubleTypeConflict" for type "number": Type conflict; "integer" would override "float"`,
|
||||
],
|
||||
};
|
||||
|
||||
@@ -14,16 +14,16 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
*/
|
||||
export interface Enum {
|
||||
foo: Bar,
|
||||
foo: Bar;
|
||||
|
||||
bar: Baz,
|
||||
bar: Baz;
|
||||
|
||||
type: ThingType.Enum;
|
||||
}
|
||||
@@ -36,6 +36,7 @@ enum Bar {
|
||||
|
||||
enum Baz {
|
||||
d = 'd',
|
||||
// eslint-disable-next-line unicorn/prevent-abbreviations
|
||||
e = 'e',
|
||||
f = 'f',
|
||||
}
|
||||
@@ -48,11 +49,11 @@ export const testConfig: MapAggTestOptions = {
|
||||
map: {
|
||||
maps: {
|
||||
foo: {
|
||||
type: ElasticsearchDataType.text
|
||||
type: ElasticsearchDataType.text,
|
||||
},
|
||||
bar: {
|
||||
type: ElasticsearchDataType.text
|
||||
}
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.text,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
export type FilterableEnumType = 'a' | 'b' | 'c';
|
||||
@@ -38,14 +38,14 @@ export interface FilterableTag {
|
||||
/**
|
||||
* @filterable
|
||||
*/
|
||||
baz: 'some literal'
|
||||
baz: 'some literal';
|
||||
|
||||
/**
|
||||
* @filterable
|
||||
*/
|
||||
buz: FilterableEnumType
|
||||
buz: FilterableEnumType;
|
||||
|
||||
type: ThingType.FilterableTag
|
||||
type: ThingType.FilterableTag;
|
||||
}
|
||||
|
||||
export const testConfig: MapAggTestOptions = {
|
||||
@@ -57,34 +57,34 @@ export const testConfig: MapAggTestOptions = {
|
||||
type: ElasticsearchDataType.text,
|
||||
fields: {
|
||||
raw: {
|
||||
type: ElasticsearchDataType.keyword
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.keyword,
|
||||
},
|
||||
},
|
||||
},
|
||||
bar: {
|
||||
type: ElasticsearchDataType.keyword,
|
||||
fields: {
|
||||
raw: {
|
||||
type: ElasticsearchDataType.keyword
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.keyword,
|
||||
},
|
||||
},
|
||||
},
|
||||
baz: {
|
||||
type: ElasticsearchDataType.keyword,
|
||||
fields: {
|
||||
raw: {
|
||||
type: ElasticsearchDataType.keyword
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.keyword,
|
||||
},
|
||||
},
|
||||
},
|
||||
buz: {
|
||||
type: ElasticsearchDataType.keyword,
|
||||
fields: {
|
||||
raw: {
|
||||
type: ElasticsearchDataType.keyword
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.keyword,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
@@ -22,7 +22,7 @@ import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
*/
|
||||
export interface Generics {
|
||||
foo: InterfaceWithDefaultGeneric<number>;
|
||||
baz: InterfaceWithStringGeneric<string>
|
||||
baz: InterfaceWithStringGeneric<string>;
|
||||
|
||||
type: ThingType.Generics;
|
||||
}
|
||||
@@ -44,18 +44,18 @@ export const testConfig: MapAggTestOptions = {
|
||||
dynamic: 'strict',
|
||||
properties: {
|
||||
bar: {
|
||||
type: ElasticsearchDataType.integer
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.integer,
|
||||
},
|
||||
},
|
||||
},
|
||||
baz: {
|
||||
dynamic: 'strict',
|
||||
properties: {
|
||||
bar: {
|
||||
type: ElasticsearchDataType.text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.text,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
@@ -23,7 +23,7 @@ import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
export interface ImpossibleUnion {
|
||||
foo: 'a' | 1 | boolean;
|
||||
|
||||
type: ThingType.ImpossibleUnion
|
||||
type: ThingType.ImpossibleUnion;
|
||||
}
|
||||
|
||||
export const testConfig: MapAggTestOptions = {
|
||||
@@ -32,11 +32,11 @@ export const testConfig: MapAggTestOptions = {
|
||||
map: {
|
||||
maps: {
|
||||
foo: {
|
||||
type: ElasticsearchDataType.boolean
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.boolean,
|
||||
},
|
||||
},
|
||||
},
|
||||
err: [
|
||||
`At "${ThingType.ImpossibleUnion}::foo" for type "[{"type":"1","name":"2"},"unknown","1"]": Not implemented type`
|
||||
]
|
||||
`At "${ThingType.ImpossibleUnion}::foo" for type "[{"type":"1","name":"2"},"unknown","1"]": Not implemented type`,
|
||||
],
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
@@ -41,7 +41,6 @@ export interface DoubleTypeConflict {
|
||||
*/
|
||||
floatString: string;
|
||||
|
||||
|
||||
type: ThingType.IncompatibleType;
|
||||
}
|
||||
|
||||
@@ -51,23 +50,23 @@ export const testConfig: MapAggTestOptions = {
|
||||
map: {
|
||||
maps: {
|
||||
keywordNumber: {
|
||||
type: ElasticsearchDataType.integer
|
||||
type: ElasticsearchDataType.integer,
|
||||
},
|
||||
textNumber: {
|
||||
type: ElasticsearchDataType.integer
|
||||
type: ElasticsearchDataType.integer,
|
||||
},
|
||||
integerString: {
|
||||
type: ElasticsearchDataType.text
|
||||
type: ElasticsearchDataType.text,
|
||||
},
|
||||
floatString: {
|
||||
type: ElasticsearchDataType.text
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.text,
|
||||
},
|
||||
},
|
||||
},
|
||||
err: [
|
||||
`At "${ThingType.IncompatibleType}::keywordNumber" for tag "keyword": Not implemented tag`,
|
||||
`At "${ThingType.IncompatibleType}::textNumber" for tag "text": Not implemented tag`,
|
||||
`At "${ThingType.IncompatibleType}::floatString" for tag "float": Not implemented tag`,
|
||||
`At "${ThingType.IncompatibleType}::integerString" for tag "integer": Not implemented tag`,
|
||||
]
|
||||
],
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
@@ -25,8 +25,8 @@ export interface IndexSignature {
|
||||
[key: string]: {
|
||||
bar: number;
|
||||
baz: string;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
type: ThingType.IndexSignature;
|
||||
}
|
||||
@@ -38,8 +38,8 @@ export const testConfig: MapAggTestOptions = {
|
||||
maps: {
|
||||
foo: {
|
||||
dynamic: true,
|
||||
properties: {}
|
||||
}
|
||||
properties: {},
|
||||
},
|
||||
},
|
||||
dynamicTemplates: [
|
||||
{
|
||||
@@ -48,18 +48,18 @@ export const testConfig: MapAggTestOptions = {
|
||||
dynamic: 'strict',
|
||||
properties: {
|
||||
bar: {
|
||||
type: ElasticsearchDataType.integer
|
||||
type: ElasticsearchDataType.integer,
|
||||
},
|
||||
baz: {
|
||||
type: ElasticsearchDataType.text
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.text,
|
||||
},
|
||||
},
|
||||
},
|
||||
match: '*',
|
||||
match_mapping_type: '*',
|
||||
path_match: 'foo.*'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
path_match: 'foo.*',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types';
|
||||
|
||||
/**
|
||||
@@ -36,7 +36,7 @@ export interface InferredTypeFilterable {
|
||||
*/
|
||||
bar: SCISO8601Date;
|
||||
|
||||
type: ThingType.InferredTypeFilterable
|
||||
type: ThingType.InferredTypeFilterable;
|
||||
}
|
||||
|
||||
export const testConfig: MapAggTestOptions = {
|
||||
@@ -49,12 +49,12 @@ export const testConfig: MapAggTestOptions = {
|
||||
fields: {
|
||||
raw: {
|
||||
type: ElasticsearchDataType.keyword,
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
bar: {
|
||||
type: ElasticsearchDataType.date,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types';
|
||||
|
||||
/**
|
||||
@@ -24,14 +24,14 @@ export interface InheritTags {
|
||||
/**
|
||||
* @inheritTags inherit tags::bar.baz
|
||||
*/
|
||||
foo: number,
|
||||
foo: number;
|
||||
|
||||
bar: {
|
||||
/**
|
||||
* @float
|
||||
*/
|
||||
baz: number
|
||||
}
|
||||
baz: number;
|
||||
};
|
||||
|
||||
type: ThingType.InheritTags;
|
||||
}
|
||||
@@ -42,16 +42,16 @@ export const testConfig: MapAggTestOptions = {
|
||||
map: {
|
||||
maps: {
|
||||
foo: {
|
||||
type: ElasticsearchDataType.float
|
||||
type: ElasticsearchDataType.float,
|
||||
},
|
||||
bar: {
|
||||
dynamic: 'strict',
|
||||
properties: {
|
||||
baz: {
|
||||
type: ElasticsearchDataType.float
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.float,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
*/
|
||||
export interface InheritedProperty extends Bar{
|
||||
foo: number,
|
||||
export interface InheritedProperty extends Bar {
|
||||
foo: number;
|
||||
|
||||
type: ThingType.InheritedProperty;
|
||||
}
|
||||
@@ -44,14 +44,14 @@ export const testConfig: MapAggTestOptions = {
|
||||
map: {
|
||||
maps: {
|
||||
foo: {
|
||||
type: ElasticsearchDataType.integer
|
||||
type: ElasticsearchDataType.integer,
|
||||
},
|
||||
bar: {
|
||||
type: ElasticsearchDataType.keyword
|
||||
type: ElasticsearchDataType.keyword,
|
||||
},
|
||||
baz: {
|
||||
type: ElasticsearchDataType.float
|
||||
}
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.float,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable jsdoc/check-tag-names */
|
||||
/*
|
||||
* Copyright (C) 2020 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
@@ -14,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
@@ -35,11 +36,9 @@ export const testConfig: MapAggTestOptions = {
|
||||
map: {
|
||||
maps: {
|
||||
foo: {
|
||||
type: ElasticsearchDataType.text
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.text,
|
||||
},
|
||||
},
|
||||
},
|
||||
err: [
|
||||
`At "${ThingType.InvalidTag}::foo" for tag "aninvalidtag": Not implemented tag`
|
||||
]
|
||||
err: [`At "${ThingType.InvalidTag}::foo" for tag "aninvalidtag": Not implemented tag`],
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
@@ -44,12 +44,12 @@ export interface MapExplicitTypes {
|
||||
/**
|
||||
* @date
|
||||
*/
|
||||
esEpochMsDate: number
|
||||
esEpochMsDate: number;
|
||||
|
||||
/**
|
||||
* @date
|
||||
*/
|
||||
esStringDate: string
|
||||
esStringDate: string;
|
||||
|
||||
type: ThingType.MapExplicitTypes;
|
||||
}
|
||||
@@ -60,23 +60,23 @@ export const testConfig: MapAggTestOptions = {
|
||||
map: {
|
||||
maps: {
|
||||
esInteger: {
|
||||
type: ElasticsearchDataType.integer
|
||||
type: ElasticsearchDataType.integer,
|
||||
},
|
||||
esFloat: {
|
||||
type: ElasticsearchDataType.float
|
||||
type: ElasticsearchDataType.float,
|
||||
},
|
||||
esKeyword: {
|
||||
type: ElasticsearchDataType.keyword
|
||||
type: ElasticsearchDataType.keyword,
|
||||
},
|
||||
esText: {
|
||||
type: ElasticsearchDataType.text
|
||||
type: ElasticsearchDataType.text,
|
||||
},
|
||||
esEpochMsDate: {
|
||||
type: ElasticsearchDataType.date
|
||||
type: ElasticsearchDataType.date,
|
||||
},
|
||||
esStringDate: {
|
||||
type: ElasticsearchDataType.date
|
||||
type: ElasticsearchDataType.date,
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
@@ -35,11 +35,9 @@ export const testConfig: MapAggTestOptions = {
|
||||
map: {
|
||||
maps: {
|
||||
foo: {
|
||||
type: ElasticsearchDataType.missing_premap
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.missing_premap,
|
||||
},
|
||||
},
|
||||
},
|
||||
err: [
|
||||
`At "${ThingType.MissingPremap}::foo" for external type "HTMLAllCollection": Missing pre-map`
|
||||
]
|
||||
err: [`At "${ThingType.MissingPremap}::foo" for external type "HTMLAllCollection": Missing pre-map`],
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
@@ -29,10 +29,10 @@ export interface Nested {
|
||||
* @keyword
|
||||
*/
|
||||
depth3_2: string;
|
||||
}
|
||||
};
|
||||
depth2_2: boolean;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
type: ThingType.Nested;
|
||||
}
|
||||
@@ -52,20 +52,20 @@ export const testConfig: MapAggTestOptions = {
|
||||
dynamic: 'strict',
|
||||
properties: {
|
||||
depth3_1: {
|
||||
type: ElasticsearchDataType.integer
|
||||
type: ElasticsearchDataType.integer,
|
||||
},
|
||||
depth3_2: {
|
||||
type: ElasticsearchDataType.keyword
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.keyword,
|
||||
},
|
||||
},
|
||||
},
|
||||
depth2_2: {
|
||||
type: ElasticsearchDataType.boolean
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.boolean,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
@@ -23,7 +23,7 @@ import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
export interface ObjectUnion {
|
||||
foo: Boo | Buu;
|
||||
|
||||
type: ThingType.ObjectUnion
|
||||
type: ThingType.ObjectUnion;
|
||||
}
|
||||
|
||||
// we can't name them Bar or Baz, look here for more info:
|
||||
@@ -49,16 +49,16 @@ export const testConfig: MapAggTestOptions = {
|
||||
dynamic: 'strict',
|
||||
properties: {
|
||||
a: {
|
||||
type: ElasticsearchDataType.boolean
|
||||
type: ElasticsearchDataType.boolean,
|
||||
},
|
||||
b: {
|
||||
type: ElasticsearchDataType.integer
|
||||
type: ElasticsearchDataType.integer,
|
||||
},
|
||||
intersection: {
|
||||
type: ElasticsearchDataType.text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.text,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
@@ -46,23 +46,24 @@ export const testConfig: MapAggTestOptions = {
|
||||
type: ElasticsearchDataType.keyword,
|
||||
fields: {
|
||||
raw: {
|
||||
type: ElasticsearchDataType.keyword
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.keyword,
|
||||
},
|
||||
},
|
||||
},
|
||||
bar: {
|
||||
type: ElasticsearchDataType.text,
|
||||
fields: {
|
||||
raw: {
|
||||
type: ElasticsearchDataType.keyword
|
||||
type: ElasticsearchDataType.keyword,
|
||||
},
|
||||
sort: {
|
||||
analyzer: 'ducet_sort',
|
||||
fielddata: true,
|
||||
type: ElasticsearchDataType.text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
country: 'DE',
|
||||
language: 'de',
|
||||
type: 'icu_collation_keyword',
|
||||
variant: '@collation=phonebook',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
@@ -37,23 +37,23 @@ export const testConfig: MapAggTestOptions = {
|
||||
map: {
|
||||
maps: {
|
||||
numberDefault: {
|
||||
type: ElasticsearchDataType.integer
|
||||
type: ElasticsearchDataType.integer,
|
||||
},
|
||||
stringDefault: {
|
||||
type: ElasticsearchDataType.text
|
||||
type: ElasticsearchDataType.text,
|
||||
},
|
||||
booleanDefault: {
|
||||
type: ElasticsearchDataType.boolean
|
||||
type: ElasticsearchDataType.boolean,
|
||||
},
|
||||
stringLiteralDefault: {
|
||||
type: ElasticsearchDataType.keyword
|
||||
type: ElasticsearchDataType.keyword,
|
||||
},
|
||||
booleanTrueLiteralDefault: {
|
||||
type: ElasticsearchDataType.boolean
|
||||
type: ElasticsearchDataType.boolean,
|
||||
},
|
||||
booleanFalseLiteralDefault: {
|
||||
type: ElasticsearchDataType.boolean
|
||||
}
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.boolean,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
@@ -36,7 +36,7 @@ export interface SortableTag {
|
||||
*/
|
||||
baz: number;
|
||||
|
||||
type: ThingType.SortableTag
|
||||
type: ThingType.SortableTag;
|
||||
}
|
||||
|
||||
export const testConfig: MapAggTestOptions = {
|
||||
@@ -48,32 +48,35 @@ export const testConfig: MapAggTestOptions = {
|
||||
type: ElasticsearchDataType.text,
|
||||
fields: {
|
||||
sort: {
|
||||
analyzer: 'ducet_sort',
|
||||
fielddata: true,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
country: 'DE',
|
||||
language: 'de',
|
||||
type: 'icu_collation_keyword',
|
||||
variant: '@collation=phonebook',
|
||||
},
|
||||
},
|
||||
},
|
||||
bar: {
|
||||
type: ElasticsearchDataType.text,
|
||||
fields: {
|
||||
sort: {
|
||||
analyzer: 'ducet_sort',
|
||||
fielddata: true,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
country: 'DE',
|
||||
language: 'de',
|
||||
type: 'icu_collation_keyword',
|
||||
variant: '@collation=phonebook',
|
||||
},
|
||||
},
|
||||
},
|
||||
baz: {
|
||||
type: ElasticsearchDataType.integer,
|
||||
fields: {
|
||||
sort: {
|
||||
analyzer: 'ducet_sort',
|
||||
fielddata: true,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
country: 'DE',
|
||||
language: 'de',
|
||||
type: 'icu_collation_keyword',
|
||||
variant: '@collation=phonebook',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
@@ -23,19 +23,19 @@ export interface TagsIgnoreCase {
|
||||
/**
|
||||
* @inheritTags inherit tags::bar.baz
|
||||
*/
|
||||
camelCase: number,
|
||||
camelCase: number;
|
||||
|
||||
/**
|
||||
* @inherittags inherit tags::bar.baz
|
||||
* @inheritTags inherit tags::bar.baz
|
||||
*/
|
||||
lowerCase: number,
|
||||
lowerCase: number;
|
||||
|
||||
bar: {
|
||||
/**
|
||||
* @float
|
||||
*/
|
||||
baz: number
|
||||
}
|
||||
baz: number;
|
||||
};
|
||||
|
||||
type: ThingType.TagsIgnoreCase;
|
||||
}
|
||||
@@ -46,19 +46,19 @@ export const testConfig: MapAggTestOptions = {
|
||||
map: {
|
||||
maps: {
|
||||
camelCase: {
|
||||
type: ElasticsearchDataType.float
|
||||
type: ElasticsearchDataType.float,
|
||||
},
|
||||
lowerCase: {
|
||||
type: ElasticsearchDataType.float
|
||||
type: ElasticsearchDataType.float,
|
||||
},
|
||||
bar: {
|
||||
dynamic: 'strict',
|
||||
properties: {
|
||||
baz: {
|
||||
type: ElasticsearchDataType.float
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.float,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
@@ -24,17 +24,17 @@ export interface TypeAlias {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
textProperty: ATextAlias,
|
||||
textProperty: ATextAlias;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
keywordProperty: AKeywordAlias,
|
||||
keywordProperty: AKeywordAlias;
|
||||
|
||||
/**
|
||||
* @keyword
|
||||
*/
|
||||
overriddenTextAsKeyword: ATextAlias
|
||||
overriddenTextAsKeyword: ATextAlias;
|
||||
|
||||
type: ThingType.TypeAlias;
|
||||
}
|
||||
@@ -63,6 +63,6 @@ export const testConfig: MapAggTestOptions = {
|
||||
overriddenTextAsKeyword: {
|
||||
type: ElasticsearchDataType.keyword,
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
export interface SCISO8601DateRange {
|
||||
@@ -27,7 +27,7 @@ export interface SCISO8601DateRange {
|
||||
export interface TypeOverrides {
|
||||
foo: SCISO8601DateRange;
|
||||
|
||||
type: ThingType.TypeOverrides
|
||||
type: ThingType.TypeOverrides;
|
||||
}
|
||||
|
||||
export const testConfig: MapAggTestOptions = {
|
||||
@@ -38,6 +38,6 @@ export const testConfig: MapAggTestOptions = {
|
||||
foo: {
|
||||
type: ElasticsearchDataType.date_range,
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
@@ -29,7 +29,7 @@ export interface TypeQuery {
|
||||
enum Bar {
|
||||
'a',
|
||||
'b',
|
||||
'c'
|
||||
'c',
|
||||
}
|
||||
|
||||
// https://gitlab.com/openstapps/core-tools/-/issues/47
|
||||
@@ -39,8 +39,8 @@ export const testConfig: MapAggTestOptions = {
|
||||
map: {
|
||||
maps: {
|
||||
foo: {
|
||||
type: ElasticsearchDataType.text
|
||||
}
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.text,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../MapAggTestOptions';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ElasticsearchDataType} from '../../../../src/config/typemap';
|
||||
|
||||
/**
|
||||
@@ -36,7 +36,7 @@ export interface TypeWrapperInheritance {
|
||||
*/
|
||||
stringLiteralWrapper: StringLiteralWrapper;
|
||||
|
||||
type: ThingType.TypeWrapperInheritance
|
||||
type: ThingType.TypeWrapperInheritance;
|
||||
}
|
||||
|
||||
type NumberWrapper = number;
|
||||
@@ -53,16 +53,16 @@ export const testConfig: MapAggTestOptions = {
|
||||
dynamic: 'strict',
|
||||
properties: {
|
||||
numberWrapper: {
|
||||
type: ElasticsearchDataType.float
|
||||
type: ElasticsearchDataType.float,
|
||||
},
|
||||
stringWrapper: {
|
||||
type: ElasticsearchDataType.keyword
|
||||
type: ElasticsearchDataType.keyword,
|
||||
},
|
||||
stringLiteralWrapper: {
|
||||
type: ElasticsearchDataType.text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: ElasticsearchDataType.text,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user