Skip to content

Commit c27e369

Browse files
Remove unnecessary ScoreFunctionBase (#1666) (#1668)
Co-authored-by: Sylvain Wallez <[email protected]>
1 parent 27800d5 commit c27e369

File tree

3 files changed

+27
-94
lines changed

3 files changed

+27
-94
lines changed

output/schema/schema.json

Lines changed: 14 additions & 70 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 7 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_types/query_dsl/compound.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,16 @@ export class FunctionScoreQuery extends QueryBase {
5858
score_mode?: FunctionScoreMode
5959
}
6060

61-
export class ScoreFunctionBase {
62-
filter?: QueryContainer
63-
weight?: double
64-
}
65-
66-
export class WeightScoreFunction extends ScoreFunctionBase {}
67-
68-
export class ScriptScoreFunction extends ScoreFunctionBase {
61+
export class ScriptScoreFunction {
6962
script: Script
7063
}
7164

72-
export class RandomScoreFunction extends ScoreFunctionBase {
65+
export class RandomScoreFunction {
7366
field?: Field
7467
seed?: long | string
7568
}
7669

77-
export class FieldValueFactorScoreFunction extends ScoreFunctionBase {
70+
export class FieldValueFactorScoreFunction {
7871
field: Field
7972
factor?: double
8073
missing?: double
@@ -88,7 +81,7 @@ export class DecayPlacement<TOrigin, TScale> {
8881
origin?: TOrigin
8982
}
9083

91-
export class DecayFunctionBase extends ScoreFunctionBase {
84+
export class DecayFunctionBase {
9285
multi_value_mode?: MultiValueMode
9386
}
9487

@@ -113,7 +106,8 @@ export type DecayFunction =
113106

114107
/** @variants container */
115108
// This container is valid without a variant. Also, despite being documented as a function, 'weight' is actually a
116-
// container property that can be combined with a function. From SearchModule#registerScoreFunctions in ES:
109+
// container property that can be combined with a function.
110+
// From SearchModule#registerScoreFunctions in ES:
117111
// Weight doesn't have its own parser, so every function supports it out of the box. Can be a single function too when
118112
// not associated to any other function, which is why it needs to be registered manually here.
119113
export class FunctionScoreContainer {

0 commit comments

Comments
 (0)