diff --git a/src/plugins/console/server/lib/spec_definitions/js/mappings.ts b/src/plugins/console/server/lib/spec_definitions/js/mappings.ts index 22e7287aa6374..c8352941953ae 100644 --- a/src/plugins/console/server/lib/spec_definitions/js/mappings.ts +++ b/src/plugins/console/server/lib/spec_definitions/js/mappings.ts @@ -64,6 +64,7 @@ export const mappings = (specService: SpecDefinitionsService) => { 'nested', 'geo_point', 'geo_shape', + 'dense_vector', ], }, @@ -85,7 +86,24 @@ export const mappings = (specService: SpecDefinitionsService) => { // index_prefixes: { min_chars, max_chars }, index_options: { - __one_of: ['docs', 'freqs', 'positions'], + // leave the first item blank because the default depends on type + __one_of: [ + '', + // text-based types + 'docs', + 'freqs', + 'positions', + 'offsets', + // dense_vector type + { + type: { + __one_of: ['int8_hnsw', 'hnsw', 'int4_hnsw', 'flat', 'int8_flat', 'int4_flat'], + }, + m: 16, + ef_construction: 100, + confidence_interval: 0, + }, + ], }, analyzer: 'standard', search_analyzer: 'standard', @@ -215,7 +233,18 @@ export const mappings = (specService: SpecDefinitionsService) => { }, }, similarity: { - __one_of: ['default', 'BM25'], + // leave the first item blank because the default depends on type + __one_of: [ + '', + // text-based types + 'BM25', + 'boolean', + // dense_vector type + 'l2_norm', + 'dot_product', + 'cosine', + 'max_inner_product', + ], }, // objects @@ -234,6 +263,12 @@ export const mappings = (specService: SpecDefinitionsService) => { // nested include_in_parent: BOOLEAN, include_in_root: BOOLEAN, + + // dense_vector + element_type: { + __one_of: ['float', 'byte', 'bit'], + }, + dims: 3, }, }, },