Add match_only_text and wildcard types to default fields (#131262)

This commit is contained in:
Jen Huang 2022-04-29 12:10:25 -07:00 committed by GitHub
parent 71e926b202
commit d3a750eb15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -36,6 +36,18 @@ describe('buildDefaultSettings', () => {
name: 'field2Boolean',
type: 'boolean',
},
{
name: 'field3Text',
type: 'text',
},
{
name: 'field4MatchOnlyText',
type: 'match_only_text',
},
{
name: 'field5Wildcard',
type: 'wildcard',
},
],
});
@ -49,6 +61,9 @@ describe('buildDefaultSettings', () => {
"query": Object {
"default_field": Array [
"field1Keyword",
"field3Text",
"field4MatchOnlyText",
"field5Wildcard",
],
},
},

View file

@ -8,7 +8,7 @@
import { appContextService } from '../../../app_context';
import type { Field, Fields } from '../../fields/field';
const QUERY_DEFAULT_FIELD_TYPES = ['keyword', 'text'];
const QUERY_DEFAULT_FIELD_TYPES = ['keyword', 'text', 'match_only_text', 'wildcard'];
const QUERY_DEFAULT_FIELD_LIMIT = 1024;
const flattenFieldsToNameAndType = (