mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 00:23:03 +00:00
60 lines
1.6 KiB
TypeScript
60 lines
1.6 KiB
TypeScript
/*
|
|
* Copyright (C) 2019-2021 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 {ElasticsearchFieldmap, ElasticsearchFilterableMap} from '../mapping-definitions';
|
|
import {ElasticsearchDataType} from './typemap';
|
|
|
|
export enum analyzers {
|
|
ducet_sort = 'ducet_sort',
|
|
search_german = 'search_german',
|
|
}
|
|
|
|
export const fieldmap: ElasticsearchFieldmap = {
|
|
aggregatable: {
|
|
default: {
|
|
raw: {
|
|
ignore_above: 10000,
|
|
type: ElasticsearchDataType.keyword,
|
|
},
|
|
},
|
|
ignore: ['global'],
|
|
},
|
|
sortable: {
|
|
default: {
|
|
sort: {
|
|
analyzer: analyzers.ducet_sort,
|
|
fielddata: true,
|
|
type: ElasticsearchDataType.text,
|
|
},
|
|
},
|
|
ducet: {
|
|
sort: {
|
|
analyzer: analyzers.ducet_sort,
|
|
fielddata: true,
|
|
type: ElasticsearchDataType.text,
|
|
},
|
|
},
|
|
ignore: ['price'],
|
|
},
|
|
};
|
|
|
|
export const filterableTagName = 'filterable';
|
|
|
|
export const filterableMap: ElasticsearchFilterableMap = {
|
|
date: ElasticsearchDataType.keyword,
|
|
keyword: ElasticsearchDataType.keyword,
|
|
text: ElasticsearchDataType.keyword,
|
|
integer: ElasticsearchDataType.integer,
|
|
};
|