-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathrerank_processor.ts
53 lines (51 loc) · 1.19 KB
/
rerank_processor.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { PROCESSOR_TYPE } from '../../../common';
import { Processor } from '../processor';
import { generateId } from '../../utils';
/**
* The rerank processor config. Used in search flows.
* For now, only supports the by_field type. For details, see
* https://opensearch.org/docs/latest/search-plugins/search-pipelines/rerank-processor/#the-by_field-rerank-type
*/
export class RerankProcessor extends Processor {
constructor() {
super();
this.id = generateId('rerank_processor');
this.type = PROCESSOR_TYPE.RERANK;
this.name = 'Rerank Processor';
this.fields = [
{
id: 'target_field',
type: 'string',
},
];
this.optionalFields = [
{
id: 'remove_target_field',
type: 'boolean',
value: false,
},
{
id: 'keep_previous_score',
type: 'boolean',
value: false,
},
{
id: 'tag',
type: 'string',
},
{
id: 'description',
type: 'textArea',
},
{
id: 'ignore_failure',
type: 'boolean',
value: false,
},
];
}
}