feat: add support for @inheritTags

This commit is contained in:
Wieland Schöbl
2020-02-21 15:31:26 +01:00
committed by Wieland Schöbl
parent 97f6c42407
commit 485430b7f2
8 changed files with 266 additions and 38 deletions

View File

@@ -0,0 +1,57 @@
// tslint:disable
/*
* Copyright (C) 2020 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {ElasticsearchDataType} from '../../../../src/mappings/definitions/typemap';
import {MapAggTestOptions} from '../../MapAggTestOptions';
import {ThingType} from './types';
/**
* @indexable
*/
export interface InheritTags {
/**
* @inheritTags inherit tags::bar.baz
*/
foo: number,
bar: {
/**
* @float
*/
baz: number
}
type: ThingType.InheritTags;
}
export const inheritTagsTest: MapAggTestOptions = {
name: ThingType.InheritTags,
map: {
maps: {
foo: {
type: ElasticsearchDataType.float
},
bar: {
dynamic: 'strict',
properties: {
baz: {
type: ElasticsearchDataType.float
}
}
},
}
}
};

View File

@@ -0,0 +1,49 @@
import {ThingType} from './types';
import {MapAggTestOptions} from '../../MapAggTestOptions';
import {ElasticsearchDataType} from '../../../../src/mappings/definitions/typemap';
/**
* @indexable
*/
export interface TagsIgnoreCase {
/**
* @inheritTags inherit tags::bar.baz
*/
camelCase: number,
/**
* @inherittags inherit tags::bar.baz
*/
lowerCase: number,
bar: {
/**
* @float
*/
baz: number
}
type: ThingType.TagsIgnoreCase;
}
export const tagsIgnoreCaseTest: MapAggTestOptions = {
name: ThingType.TagsIgnoreCase,
map: {
maps: {
camelCase: {
type: ElasticsearchDataType.float
},
lowerCase: {
type: ElasticsearchDataType.float
},
bar: {
dynamic: 'strict',
properties: {
baz: {
type: ElasticsearchDataType.float
}
}
},
}
}
};

View File

@@ -35,4 +35,6 @@ export enum ThingType {
PairedTags = 'paired tags',
FilterableTag = 'filterable tag',
AnyUnknown = 'any unknown',
InheritTags = 'inherit tags',
TagsIgnoreCase = 'tags ignore case',
}