diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 9f8c94e886..2b4d924064 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -41879,7 +41879,11 @@ "$ref": "#/components/schemas/indices._types:Queries" }, "similarity": { - "$ref": "#/components/schemas/indices._types:SettingsSimilarity" + "description": "Configure custom similarity settings to customize how search results are scored.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/indices._types:SettingsSimilarity" + } }, "mapping": { "$ref": "#/components/schemas/indices._types:MappingLimitSettings" @@ -44926,36 +44930,45 @@ ] }, "indices._types:SettingsSimilarity": { - "type": "object", - "properties": { - "bm25": { + "discriminator": { + "propertyName": "type" + }, + "oneOf": [ + { "$ref": "#/components/schemas/indices._types:SettingsSimilarityBm25" }, - "dfi": { + { + "$ref": "#/components/schemas/indices._types:SettingsSimilarityBoolean" + }, + { "$ref": "#/components/schemas/indices._types:SettingsSimilarityDfi" }, - "dfr": { + { "$ref": "#/components/schemas/indices._types:SettingsSimilarityDfr" }, - "ib": { + { "$ref": "#/components/schemas/indices._types:SettingsSimilarityIb" }, - "lmd": { + { "$ref": "#/components/schemas/indices._types:SettingsSimilarityLmd" }, - "lmj": { + { "$ref": "#/components/schemas/indices._types:SettingsSimilarityLmj" }, - "scripted_tfidf": { - "$ref": "#/components/schemas/indices._types:SettingsSimilarityScriptedTfidf" + { + "$ref": "#/components/schemas/indices._types:SettingsSimilarityScripted" } - }, - "minProperties": 1, - "maxProperties": 1 + ] }, "indices._types:SettingsSimilarityBm25": { "type": "object", "properties": { + "type": { + "type": "string", + "enum": [ + "BM25" + ] + }, "b": { "type": "number" }, @@ -44964,37 +44977,42 @@ }, "k1": { "type": "number" - }, + } + }, + "required": [ + "type" + ] + }, + "indices._types:SettingsSimilarityBoolean": { + "type": "object", + "properties": { "type": { "type": "string", "enum": [ - "BM25" + "boolean" ] } }, "required": [ - "b", - "discount_overlaps", - "k1", "type" ] }, "indices._types:SettingsSimilarityDfi": { "type": "object", "properties": { - "independence_measure": { - "$ref": "#/components/schemas/_types:DFIIndependenceMeasure" - }, "type": { "type": "string", "enum": [ "DFI" ] + }, + "independence_measure": { + "$ref": "#/components/schemas/_types:DFIIndependenceMeasure" } }, "required": [ - "independence_measure", - "type" + "type", + "independence_measure" ] }, "_types:DFIIndependenceMeasure": { @@ -45008,6 +45026,12 @@ "indices._types:SettingsSimilarityDfr": { "type": "object", "properties": { + "type": { + "type": "string", + "enum": [ + "DFR" + ] + }, "after_effect": { "$ref": "#/components/schemas/_types:DFRAfterEffect" }, @@ -45016,19 +45040,13 @@ }, "normalization": { "$ref": "#/components/schemas/_types:Normalization" - }, - "type": { - "type": "string", - "enum": [ - "DFR" - ] } }, "required": [ + "type", "after_effect", "basic_model", - "normalization", - "type" + "normalization" ] }, "_types:DFRAfterEffect": { @@ -45064,6 +45082,12 @@ "indices._types:SettingsSimilarityIb": { "type": "object", "properties": { + "type": { + "type": "string", + "enum": [ + "IB" + ] + }, "distribution": { "$ref": "#/components/schemas/_types:IBDistribution" }, @@ -45072,19 +45096,13 @@ }, "normalization": { "$ref": "#/components/schemas/_types:Normalization" - }, - "type": { - "type": "string", - "enum": [ - "IB" - ] } }, "required": [ + "type", "distribution", "lambda", - "normalization", - "type" + "normalization" ] }, "_types:IBDistribution": { @@ -45104,55 +45122,56 @@ "indices._types:SettingsSimilarityLmd": { "type": "object", "properties": { - "mu": { - "type": "number" - }, "type": { "type": "string", "enum": [ "LMDirichlet" ] + }, + "mu": { + "type": "number" } }, "required": [ - "mu", "type" ] }, "indices._types:SettingsSimilarityLmj": { "type": "object", "properties": { - "lambda": { - "type": "number" - }, "type": { "type": "string", "enum": [ "LMJelinekMercer" ] + }, + "lambda": { + "type": "number" } }, "required": [ - "lambda", "type" ] }, - "indices._types:SettingsSimilarityScriptedTfidf": { + "indices._types:SettingsSimilarityScripted": { "type": "object", "properties": { - "script": { - "$ref": "#/components/schemas/_types:Script" - }, "type": { "type": "string", "enum": [ "scripted" ] + }, + "script": { + "$ref": "#/components/schemas/_types:Script" + }, + "weight_script": { + "$ref": "#/components/schemas/_types:Script" } }, "required": [ - "script", - "type" + "type", + "script" ] }, "indices._types:MappingLimitSettings": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 44eb0ff7fd..b7897b1b41 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -111017,7 +111017,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L401-L403" + "specLocation": "indices/_types/IndexSettings.ts#L405-L407" }, { "kind": "interface", @@ -111687,7 +111687,7 @@ "name": "IndexCheckOnStartup", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L256-L263" + "specLocation": "indices/_types/IndexSettings.ts#L260-L267" }, { "kind": "interface", @@ -112133,7 +112133,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L248-L254" + "specLocation": "indices/_types/IndexSettings.ts#L252-L258" }, { "attachedBehaviors": [ @@ -112869,10 +112869,21 @@ "name": "similarity", "required": false, "type": { - "kind": "instance_of", - "type": { - "name": "SettingsSimilarity", - "namespace": "indices._types" + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "SettingsSimilarity", + "namespace": "indices._types" + } } } }, @@ -113044,7 +113055,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L313-L319" + "specLocation": "indices/_types/IndexSettings.ts#L317-L323" }, { "kind": "interface", @@ -113137,7 +113148,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L270-L303" + "specLocation": "indices/_types/IndexSettings.ts#L274-L307" }, { "kind": "interface", @@ -113159,7 +113170,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L305-L311" + "specLocation": "indices/_types/IndexSettings.ts#L309-L315" }, { "kind": "interface", @@ -113191,7 +113202,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L321-L324" + "specLocation": "indices/_types/IndexSettings.ts#L325-L328" }, { "kind": "interface", @@ -113548,7 +113559,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L265-L268" + "specLocation": "indices/_types/IndexSettings.ts#L269-L272" }, { "kind": "interface", @@ -113569,7 +113580,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L537-L539" + "specLocation": "indices/_types/IndexSettings.ts#L541-L543" }, { "kind": "interface", @@ -113591,7 +113602,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L541-L548" + "specLocation": "indices/_types/IndexSettings.ts#L545-L552" }, { "kind": "interface", @@ -113645,7 +113656,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L550-L555" + "specLocation": "indices/_types/IndexSettings.ts#L554-L559" }, { "kind": "interface", @@ -113669,7 +113680,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L557-L564" + "specLocation": "indices/_types/IndexSettings.ts#L561-L568" }, { "kind": "enum", @@ -113792,7 +113803,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L405-L418" + "specLocation": "indices/_types/IndexSettings.ts#L409-L422" }, { "kind": "interface", @@ -113815,7 +113826,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L430-L437" + "specLocation": "indices/_types/IndexSettings.ts#L434-L441" }, { "kind": "interface", @@ -113837,7 +113848,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L467-L473" + "specLocation": "indices/_types/IndexSettings.ts#L471-L477" }, { "kind": "interface", @@ -113859,7 +113870,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L458-L465" + "specLocation": "indices/_types/IndexSettings.ts#L462-L469" }, { "kind": "interface", @@ -113882,7 +113893,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L439-L447" + "specLocation": "indices/_types/IndexSettings.ts#L443-L451" }, { "kind": "interface", @@ -113905,7 +113916,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L449-L456" + "specLocation": "indices/_types/IndexSettings.ts#L453-L460" }, { "kind": "interface", @@ -113928,7 +113939,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L420-L428" + "specLocation": "indices/_types/IndexSettings.ts#L424-L432" }, { "kind": "interface", @@ -113949,7 +113960,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L326-L328" + "specLocation": "indices/_types/IndexSettings.ts#L330-L332" }, { "kind": "interface", @@ -113999,7 +114010,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L330-L333" + "specLocation": "indices/_types/IndexSettings.ts#L334-L337" }, { "kind": "interface", @@ -114057,7 +114068,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L397-L399" + "specLocation": "indices/_types/IndexSettings.ts#L401-L403" }, { "kind": "interface", @@ -114100,7 +114111,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L239-L242" + "specLocation": "indices/_types/IndexSettings.ts#L243-L246" }, { "kind": "enum", @@ -114193,7 +114204,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L229-L232" + "specLocation": "indices/_types/IndexSettings.ts#L233-L236" }, { "kind": "interface", @@ -114215,7 +114226,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L224-L227" + "specLocation": "indices/_types/IndexSettings.ts#L228-L231" }, { "kind": "interface", @@ -114245,7 +114256,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L244-L246" + "specLocation": "indices/_types/IndexSettings.ts#L248-L250" }, { "kind": "interface", @@ -114277,97 +114288,79 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L234-L237" + "specLocation": "indices/_types/IndexSettings.ts#L238-L241" }, { - "kind": "interface", + "kind": "type_alias", "name": { "name": "SettingsSimilarity", "namespace": "indices._types" }, - "properties": [ - { - "name": "bm25", - "required": false, - "type": { + "specLocation": "indices/_types/IndexSettings.ts#L169-L180", + "type": { + "items": [ + { "kind": "instance_of", "type": { "name": "SettingsSimilarityBm25", "namespace": "indices._types" } - } - }, - { - "name": "dfi", - "required": false, - "type": { + }, + { + "kind": "instance_of", + "type": { + "name": "SettingsSimilarityBoolean", + "namespace": "indices._types" + } + }, + { "kind": "instance_of", "type": { "name": "SettingsSimilarityDfi", "namespace": "indices._types" } - } - }, - { - "name": "dfr", - "required": false, - "type": { + }, + { "kind": "instance_of", "type": { "name": "SettingsSimilarityDfr", "namespace": "indices._types" } - } - }, - { - "name": "ib", - "required": false, - "type": { + }, + { "kind": "instance_of", "type": { "name": "SettingsSimilarityIb", "namespace": "indices._types" } - } - }, - { - "name": "lmd", - "required": false, - "type": { + }, + { "kind": "instance_of", "type": { "name": "SettingsSimilarityLmd", "namespace": "indices._types" } - } - }, - { - "name": "lmj", - "required": false, - "type": { + }, + { "kind": "instance_of", "type": { "name": "SettingsSimilarityLmj", "namespace": "indices._types" } - } - }, - { - "name": "scripted_tfidf", - "required": false, - "type": { + }, + { "kind": "instance_of", "type": { - "name": "SettingsSimilarityScriptedTfidf", + "name": "SettingsSimilarityScripted", "namespace": "indices._types" } } - } - ], - "specLocation": "indices/_types/IndexSettings.ts#L169-L181", + ], + "kind": "union_of" + }, "variants": { - "kind": "container", - "nonExhaustive": true + "kind": "internal_tag", + "tag": "type" } }, { @@ -114378,8 +114371,16 @@ }, "properties": [ { - "name": "b", + "name": "type", "required": true, + "type": { + "kind": "literal_value", + "value": "BM25" + } + }, + { + "name": "b", + "required": false, "type": { "kind": "instance_of", "type": { @@ -114390,7 +114391,7 @@ }, { "name": "discount_overlaps", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -114401,7 +114402,7 @@ }, { "name": "k1", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -114409,17 +114410,27 @@ "namespace": "_types" } } - }, + } + ], + "specLocation": "indices/_types/IndexSettings.ts#L186-L191" + }, + { + "kind": "interface", + "name": { + "name": "SettingsSimilarityBoolean", + "namespace": "indices._types" + }, + "properties": [ { "name": "type", "required": true, "type": { "kind": "literal_value", - "value": "BM25" + "value": "boolean" } } ], - "specLocation": "indices/_types/IndexSettings.ts#L183-L188" + "specLocation": "indices/_types/IndexSettings.ts#L182-L184" }, { "kind": "interface", @@ -114428,6 +114439,14 @@ "namespace": "indices._types" }, "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "DFI" + } + }, { "name": "independence_measure", "required": true, @@ -114438,17 +114457,9 @@ "namespace": "_types" } } - }, - { - "name": "type", - "required": true, - "type": { - "kind": "literal_value", - "value": "DFI" - } } ], - "specLocation": "indices/_types/IndexSettings.ts#L190-L193" + "specLocation": "indices/_types/IndexSettings.ts#L193-L196" }, { "kind": "interface", @@ -114457,6 +114468,14 @@ "namespace": "indices._types" }, "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "DFR" + } + }, { "name": "after_effect", "required": true, @@ -114489,17 +114508,9 @@ "namespace": "_types" } } - }, - { - "name": "type", - "required": true, - "type": { - "kind": "literal_value", - "value": "DFR" - } } ], - "specLocation": "indices/_types/IndexSettings.ts#L195-L200" + "specLocation": "indices/_types/IndexSettings.ts#L198-L203" }, { "kind": "interface", @@ -114508,6 +114519,14 @@ "namespace": "indices._types" }, "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "IB" + } + }, { "name": "distribution", "required": true, @@ -114540,17 +114559,9 @@ "namespace": "_types" } } - }, - { - "name": "type", - "required": true, - "type": { - "kind": "literal_value", - "value": "IB" - } } ], - "specLocation": "indices/_types/IndexSettings.ts#L202-L207" + "specLocation": "indices/_types/IndexSettings.ts#L205-L210" }, { "kind": "interface", @@ -114560,26 +114571,26 @@ }, "properties": [ { - "name": "mu", + "name": "type", "required": true, "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } + "kind": "literal_value", + "value": "LMDirichlet" } }, { - "name": "type", - "required": true, + "name": "mu", + "required": false, "type": { - "kind": "literal_value", - "value": "LMDirichlet" + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } } } ], - "specLocation": "indices/_types/IndexSettings.ts#L209-L212" + "specLocation": "indices/_types/IndexSettings.ts#L212-L215" }, { "kind": "interface", @@ -114589,8 +114600,16 @@ }, "properties": [ { - "name": "lambda", + "name": "type", "required": true, + "type": { + "kind": "literal_value", + "value": "LMJelinekMercer" + } + }, + { + "name": "lambda", + "required": false, "type": { "kind": "instance_of", "type": { @@ -114598,25 +114617,25 @@ "namespace": "_types" } } - }, - { - "name": "type", - "required": true, - "type": { - "kind": "literal_value", - "value": "LMJelinekMercer" - } } ], - "specLocation": "indices/_types/IndexSettings.ts#L214-L217" + "specLocation": "indices/_types/IndexSettings.ts#L217-L220" }, { "kind": "interface", "name": { - "name": "SettingsSimilarityScriptedTfidf", + "name": "SettingsSimilarityScripted", "namespace": "indices._types" }, "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "scripted" + } + }, { "name": "script", "required": true, @@ -114629,15 +114648,18 @@ } }, { - "name": "type", - "required": true, + "name": "weight_script", + "required": false, "type": { - "kind": "literal_value", - "value": "scripted" + "kind": "instance_of", + "type": { + "name": "Script", + "namespace": "_types" + } } } ], - "specLocation": "indices/_types/IndexSettings.ts#L219-L222" + "specLocation": "indices/_types/IndexSettings.ts#L222-L226" }, { "kind": "interface", @@ -114691,7 +114713,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L475-L480" + "specLocation": "indices/_types/IndexSettings.ts#L479-L484" }, { "kind": "interface", @@ -114745,7 +114767,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L487-L492" + "specLocation": "indices/_types/IndexSettings.ts#L491-L496" }, { "kind": "interface", @@ -114777,7 +114799,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L482-L485" + "specLocation": "indices/_types/IndexSettings.ts#L486-L489" }, { "kind": "interface", @@ -114845,7 +114867,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L494-L503" + "specLocation": "indices/_types/IndexSettings.ts#L498-L507" }, { "isOpen": true, @@ -114875,7 +114897,7 @@ "name": "StorageType", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L505-L535" + "specLocation": "indices/_types/IndexSettings.ts#L509-L539" }, { "kind": "interface", @@ -115032,7 +115054,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L335-L357" + "specLocation": "indices/_types/IndexSettings.ts#L339-L361" }, { "kind": "enum", @@ -115056,7 +115078,7 @@ "name": "TranslogDurability", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L359-L374" + "specLocation": "indices/_types/IndexSettings.ts#L363-L378" }, { "kind": "interface", @@ -115092,7 +115114,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L376-L395" + "specLocation": "indices/_types/IndexSettings.ts#L380-L399" }, { "kind": "enum", @@ -155897,9 +155919,7 @@ }, { "availability": { - "serverless": { - "since": "8.12.0" - }, + "serverless": {}, "stack": { "since": "8.12.0" } diff --git a/output/typescript/types.ts b/output/typescript/types.ts index dd4728d8e4..9b46125716 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -9883,7 +9883,7 @@ export interface IndicesIndexSettingsKeys { settings?: IndicesIndexSettings time_series?: IndicesIndexSettingsTimeSeries queries?: IndicesQueries - similarity?: IndicesSettingsSimilarity + similarity?: Record mapping?: IndicesMappingLimitSettings 'indexing.slowlog'?: IndicesIndexingSlowlogSettings indexing_pressure?: IndicesIndexingPressure @@ -10061,55 +10061,52 @@ export interface IndicesSettingsSearch { slowlog?: IndicesSlowlogSettings } -export interface IndicesSettingsSimilarity { - bm25?: IndicesSettingsSimilarityBm25 - dfi?: IndicesSettingsSimilarityDfi - dfr?: IndicesSettingsSimilarityDfr - ib?: IndicesSettingsSimilarityIb - lmd?: IndicesSettingsSimilarityLmd - lmj?: IndicesSettingsSimilarityLmj - scripted_tfidf?: IndicesSettingsSimilarityScriptedTfidf -} +export type IndicesSettingsSimilarity = IndicesSettingsSimilarityBm25 | IndicesSettingsSimilarityBoolean | IndicesSettingsSimilarityDfi | IndicesSettingsSimilarityDfr | IndicesSettingsSimilarityIb | IndicesSettingsSimilarityLmd | IndicesSettingsSimilarityLmj | IndicesSettingsSimilarityScripted export interface IndicesSettingsSimilarityBm25 { - b: double - discount_overlaps: boolean - k1: double type: 'BM25' + b?: double + discount_overlaps?: boolean + k1?: double +} + +export interface IndicesSettingsSimilarityBoolean { + type: 'boolean' } export interface IndicesSettingsSimilarityDfi { - independence_measure: DFIIndependenceMeasure type: 'DFI' + independence_measure: DFIIndependenceMeasure } export interface IndicesSettingsSimilarityDfr { + type: 'DFR' after_effect: DFRAfterEffect basic_model: DFRBasicModel normalization: Normalization - type: 'DFR' } export interface IndicesSettingsSimilarityIb { + type: 'IB' distribution: IBDistribution lambda: IBLambda normalization: Normalization - type: 'IB' } export interface IndicesSettingsSimilarityLmd { - mu: integer type: 'LMDirichlet' + mu?: double } export interface IndicesSettingsSimilarityLmj { - lambda: double type: 'LMJelinekMercer' + lambda?: double } -export interface IndicesSettingsSimilarityScriptedTfidf { - script: Script +export interface IndicesSettingsSimilarityScripted { type: 'scripted' + script: Script + weight_script?: Script } export interface IndicesSlowlogSettings { diff --git a/specification/indices/_types/IndexSettings.ts b/specification/indices/_types/IndexSettings.ts index df538542a0..3ffce4f1f7 100644 --- a/specification/indices/_types/IndexSettings.ts +++ b/specification/indices/_types/IndexSettings.ts @@ -150,7 +150,7 @@ export class IndexSettings /** * Configure custom similarity settings to customize how search results are scored. */ - similarity?: SettingsSimilarity + similarity?: Dictionary /** * Enable or disable dynamic mapping for an index. */ @@ -167,58 +167,62 @@ export class IndexSettings } /** - * @variants container - * @non_exhaustive + * @variants internal tag='type' */ -export class SettingsSimilarity { - bm25?: SettingsSimilarityBm25 - dfi?: SettingsSimilarityDfi - dfr?: SettingsSimilarityDfr - ib?: SettingsSimilarityIb - lmd?: SettingsSimilarityLmd - lmj?: SettingsSimilarityLmj - scripted_tfidf?: SettingsSimilarityScriptedTfidf +export type SettingsSimilarity = + | SettingsSimilarityBm25 + | SettingsSimilarityBoolean + | SettingsSimilarityDfi + | SettingsSimilarityDfr + | SettingsSimilarityIb + | SettingsSimilarityLmd + | SettingsSimilarityLmj + | SettingsSimilarityScripted + +export class SettingsSimilarityBoolean { + type: 'boolean' } export class SettingsSimilarityBm25 { - b: double - discount_overlaps: boolean - k1: double type: 'BM25' + b?: double + discount_overlaps?: boolean + k1?: double } export class SettingsSimilarityDfi { - independence_measure: DFIIndependenceMeasure type: 'DFI' + independence_measure: DFIIndependenceMeasure } export class SettingsSimilarityDfr { + type: 'DFR' after_effect: DFRAfterEffect basic_model: DFRBasicModel normalization: Normalization - type: 'DFR' } export class SettingsSimilarityIb { + type: 'IB' distribution: IBDistribution lambda: IBLambda normalization: Normalization - type: 'IB' } export class SettingsSimilarityLmd { - mu: integer type: 'LMDirichlet' + mu?: double } export class SettingsSimilarityLmj { - lambda: double type: 'LMJelinekMercer' + lambda?: double } -export class SettingsSimilarityScriptedTfidf { - script: Script +export class SettingsSimilarityScripted { type: 'scripted' + script: Script + weight_script?: Script } export class SettingsHighlight {