Skip to content
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

[8.x] Add autocomplete suggestions for dense_vector type (#190769) #193570

Merged
merged 1 commit into from
Sep 20, 2024
Merged
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
39 changes: 37 additions & 2 deletions src/plugins/console/server/lib/spec_definitions/js/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const mappings = (specService: SpecDefinitionsService) => {
'nested',
'geo_point',
'geo_shape',
'dense_vector',
],
},

Expand All @@ -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',
Expand Down Expand Up @@ -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
Expand All @@ -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,
},
},
},
Expand Down