Skip to content

Remove unnecessary ScoreFunctionBase #1666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 14 additions & 70 deletions output/schema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 7 additions & 12 deletions output/typescript/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 6 additions & 12 deletions specification/_types/query_dsl/compound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,16 @@ export class FunctionScoreQuery extends QueryBase {
score_mode?: FunctionScoreMode
}

export class ScoreFunctionBase {
filter?: QueryContainer
weight?: double
}

export class WeightScoreFunction extends ScoreFunctionBase {}

export class ScriptScoreFunction extends ScoreFunctionBase {
export class ScriptScoreFunction {
script: Script
}

export class RandomScoreFunction extends ScoreFunctionBase {
export class RandomScoreFunction {
field?: Field
seed?: long | string
}

export class FieldValueFactorScoreFunction extends ScoreFunctionBase {
export class FieldValueFactorScoreFunction {
field: Field
factor?: double
missing?: double
Expand All @@ -88,7 +81,7 @@ export class DecayPlacement<TOrigin, TScale> {
origin?: TOrigin
}

export class DecayFunctionBase extends ScoreFunctionBase {
export class DecayFunctionBase {
multi_value_mode?: MultiValueMode
}

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

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