diff --git a/output/schema/schema.json b/output/schema/schema.json index 2c09da38c2..f9cab3627f 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -60643,7 +60643,7 @@ "namespace": "_types.query_dsl" }, "properties": [], - "specLocation": "_types/query_dsl/compound.ts#L99-L101" + "specLocation": "_types/query_dsl/compound.ts#L92-L94" }, { "inherits": { @@ -60815,7 +60815,7 @@ "name": "DecayFunction", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/compound.ts#L107-L112", + "specLocation": "_types/query_dsl/compound.ts#L100-L105", "type": { "items": [ { @@ -60844,12 +60844,6 @@ } }, { - "inherits": { - "type": { - "name": "ScoreFunctionBase", - "namespace": "_types.query_dsl" - } - }, "kind": "interface", "name": { "name": "DecayFunctionBase", @@ -60868,7 +60862,7 @@ } } ], - "specLocation": "_types/query_dsl/compound.ts#L91-L93" + "specLocation": "_types/query_dsl/compound.ts#L84-L86" }, { "generics": [ @@ -60932,7 +60926,7 @@ } } ], - "specLocation": "_types/query_dsl/compound.ts#L84-L89" + "specLocation": "_types/query_dsl/compound.ts#L77-L82" }, { "inherits": { @@ -61232,15 +61226,9 @@ "name": "FieldValueFactorModifier", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/compound.ts#L151-L162" + "specLocation": "_types/query_dsl/compound.ts#L145-L156" }, { - "inherits": { - "type": { - "name": "ScoreFunctionBase", - "namespace": "_types.query_dsl" - } - }, "kind": "interface", "name": { "name": "FieldValueFactorScoreFunction", @@ -61292,7 +61280,7 @@ } } ], - "specLocation": "_types/query_dsl/compound.ts#L77-L82" + "specLocation": "_types/query_dsl/compound.ts#L70-L75" }, { "kind": "enum", @@ -61320,7 +61308,7 @@ "name": "FunctionBoostMode", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/compound.ts#L142-L149" + "specLocation": "_types/query_dsl/compound.ts#L136-L143" }, { "kind": "interface", @@ -61420,7 +61408,7 @@ } } ], - "specLocation": "_types/query_dsl/compound.ts#L114-L131", + "specLocation": "_types/query_dsl/compound.ts#L107-L125", "variants": { "kind": "container" } @@ -61451,7 +61439,7 @@ "name": "FunctionScoreMode", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/compound.ts#L133-L140" + "specLocation": "_types/query_dsl/compound.ts#L127-L134" }, { "inherits": { @@ -61777,7 +61765,7 @@ "namespace": "_types.query_dsl" }, "properties": [], - "specLocation": "_types/query_dsl/compound.ts#L103-L105" + "specLocation": "_types/query_dsl/compound.ts#L96-L98" }, { "inherits": { @@ -64097,7 +64085,7 @@ "name": "MultiValueMode", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/compound.ts#L164-L169" + "specLocation": "_types/query_dsl/compound.ts#L158-L163" }, { "inherits": { @@ -64334,7 +64322,7 @@ "namespace": "_types.query_dsl" }, "properties": [], - "specLocation": "_types/query_dsl/compound.ts#L95-L97" + "specLocation": "_types/query_dsl/compound.ts#L88-L90" }, { "kind": "enum", @@ -65783,12 +65771,6 @@ "specLocation": "_types/query_dsl/fulltext.ts#L233-L269" }, { - "inherits": { - "type": { - "name": "ScoreFunctionBase", - "namespace": "_types.query_dsl" - } - }, "kind": "interface", "name": { "name": "RandomScoreFunction", @@ -65830,7 +65812,7 @@ } } ], - "specLocation": "_types/query_dsl/compound.ts#L72-L75" + "specLocation": "_types/query_dsl/compound.ts#L65-L68" }, { "codegenNames": [ @@ -66171,38 +66153,6 @@ "shortcutProperty": "value", "specLocation": "_types/query_dsl/term.ts#L111-L123" }, - { - "kind": "interface", - "name": { - "name": "ScoreFunctionBase", - "namespace": "_types.query_dsl" - }, - "properties": [ - { - "name": "filter", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "QueryContainer", - "namespace": "_types.query_dsl" - } - } - }, - { - "name": "weight", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - } - ], - "specLocation": "_types/query_dsl/compound.ts#L61-L64" - }, { "inherits": { "type": { @@ -66231,12 +66181,6 @@ "specLocation": "_types/query_dsl/specialized.ts#L164-L166" }, { - "inherits": { - "type": { - "name": "ScoreFunctionBase", - "namespace": "_types.query_dsl" - } - }, "kind": "interface", "name": { "name": "ScriptScoreFunction", @@ -66255,7 +66199,7 @@ } } ], - "specLocation": "_types/query_dsl/compound.ts#L68-L70" + "specLocation": "_types/query_dsl/compound.ts#L61-L63" }, { "inherits": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index ce959d2b2c..5e0519f9f2 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -4951,7 +4951,7 @@ export interface QueryDslConstantScoreQuery extends QueryDslQueryBase { export interface QueryDslDateDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslDateDecayFunction = QueryDslDateDecayFunctionKeys - & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode | QueryDslQueryContainer | double } + & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export interface QueryDslDateDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } @@ -4969,7 +4969,7 @@ export interface QueryDslDateRangeQuery extends QueryDslRangeQueryBase { export type QueryDslDecayFunction = QueryDslDateDecayFunction | QueryDslNumericDecayFunction | QueryDslGeoDecayFunction -export interface QueryDslDecayFunctionBase extends QueryDslScoreFunctionBase { +export interface QueryDslDecayFunctionBase { multi_value_mode?: QueryDslMultiValueMode } @@ -5012,7 +5012,7 @@ export interface QueryDslFieldLookup { export type QueryDslFieldValueFactorModifier = 'none' | 'log' | 'log1p' | 'log2p' | 'ln' | 'ln1p' | 'ln2p' | 'square' | 'sqrt' | 'reciprocal' -export interface QueryDslFieldValueFactorScoreFunction extends QueryDslScoreFunctionBase { +export interface QueryDslFieldValueFactorScoreFunction { field: Field factor?: double missing?: double @@ -5063,7 +5063,7 @@ export type QueryDslGeoBoundingBoxQuery = QueryDslGeoBoundingBoxQueryKeys export interface QueryDslGeoDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslGeoDecayFunction = QueryDslGeoDecayFunctionKeys - & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode | QueryDslQueryContainer | double } + & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export interface QueryDslGeoDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } @@ -5329,7 +5329,7 @@ export interface QueryDslNumberRangeQuery extends QueryDslRangeQueryBase { export interface QueryDslNumericDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslNumericDecayFunction = QueryDslNumericDecayFunctionKeys - & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode | QueryDslQueryContainer | double } + & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export type QueryDslOperator = 'and' | 'AND' | 'or' | 'OR' @@ -5459,7 +5459,7 @@ export interface QueryDslQueryStringQuery extends QueryDslQueryBase { type?: QueryDslTextQueryType } -export interface QueryDslRandomScoreFunction extends QueryDslScoreFunctionBase { +export interface QueryDslRandomScoreFunction { field?: Field seed?: long | string } @@ -5509,16 +5509,11 @@ export interface QueryDslRegexpQuery extends QueryDslQueryBase { value: string } -export interface QueryDslScoreFunctionBase { - filter?: QueryDslQueryContainer - weight?: double -} - export interface QueryDslScriptQuery extends QueryDslQueryBase { script: Script } -export interface QueryDslScriptScoreFunction extends QueryDslScoreFunctionBase { +export interface QueryDslScriptScoreFunction { script: Script } diff --git a/specification/_types/query_dsl/compound.ts b/specification/_types/query_dsl/compound.ts index 5bb85a72a9..3b4a44e545 100644 --- a/specification/_types/query_dsl/compound.ts +++ b/specification/_types/query_dsl/compound.ts @@ -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 @@ -88,7 +81,7 @@ export class DecayPlacement { origin?: TOrigin } -export class DecayFunctionBase extends ScoreFunctionBase { +export class DecayFunctionBase { multi_value_mode?: MultiValueMode } @@ -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 {