feat: add automatic mapping generation

Fixes #6
This commit is contained in:
Anselm Stordeur
2019-02-05 14:54:52 +01:00
committed by Wieland Schöbl
parent 969badfb29
commit 7b198f95ce
13 changed files with 1267 additions and 78 deletions

View File

@@ -0,0 +1,50 @@
/*
* Copyright (C) 2019 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} 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: [],
},
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'],
},
};