mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-10 19:52:53 +00:00
feat: add support for @inheritTags
This commit is contained in:
committed by
Wieland Schöbl
parent
97f6c42407
commit
485430b7f2
57
test/mapping-model/mappings/src/inherit-tags.ts
Normal file
57
test/mapping-model/mappings/src/inherit-tags.ts
Normal 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
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
49
test/mapping-model/mappings/src/tags-ignore-case.ts
Normal file
49
test/mapping-model/mappings/src/tags-ignore-case.ts
Normal 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
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -35,4 +35,6 @@ export enum ThingType {
|
||||
PairedTags = 'paired tags',
|
||||
FilterableTag = 'filterable tag',
|
||||
AnyUnknown = 'any unknown',
|
||||
InheritTags = 'inherit tags',
|
||||
TagsIgnoreCase = 'tags ignore case',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user