Skip to content

Commit 6209217

Browse files
authored
Improve Analyzer definitions and fix various classes (#3215)
1 parent 98d9466 commit 6209217

File tree

13 files changed

+5673
-16150
lines changed

13 files changed

+5673
-16150
lines changed

output/schema/schema.json

Lines changed: 5555 additions & 16115 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 18 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_types/analysis/analyzers.ts

Lines changed: 85 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,42 @@ export class CustomAnalyzer {
3636

3737
export class FingerprintAnalyzer {
3838
type: 'fingerprint'
39+
/** @deprecated 7.14.0 */
3940
version?: VersionString
40-
max_output_size: integer
41-
preserve_original: boolean
42-
separator: string
43-
stopwords?: StopWords
41+
/**
42+
* The maximum token size to emit. Tokens larger than this size will be discarded.
43+
* Defaults to `255`
44+
*
45+
* @server_default 255
46+
*/
47+
max_output_size?: integer
48+
/**
49+
* The character to use to concatenate the terms.
50+
* Defaults to a space.
51+
*/
52+
separator?: string
53+
/**
54+
* A pre-defined stop words list like `_english_` or an array containing a list of stop words.
55+
* Defaults to `_none_`.
56+
*
57+
* @server_default _none_
58+
*/
59+
stopwords?: StopWords
60+
/**
61+
* The path to a file containing stop words.
62+
*/
4463
stopwords_path?: string
4564
}
4665

4766
export class KeywordAnalyzer {
4867
type: 'keyword'
68+
/** @deprecated 7.14.0 */
4969
version?: VersionString
5070
}
5171

5272
export class LanguageAnalyzer {
5373
type: 'language'
74+
/** @deprecated 7.14.0 */
5475
version?: VersionString
5576
language: Language
5677
stem_exclusion: string[]
@@ -311,6 +332,7 @@ export class ThaiAnalyzer {
311332

312333
export class NoriAnalyzer {
313334
type: 'nori'
335+
/** @deprecated 7.14.0 */
314336
version?: VersionString
315337
decompound_mode?: NoriDecompoundMode
316338
stoptags?: string[]
@@ -319,40 +341,96 @@ export class NoriAnalyzer {
319341

320342
export class PatternAnalyzer {
321343
type: 'pattern'
344+
/** @deprecated 7.14.0 */
322345
version?: VersionString
323-
flags?: string
346+
/**
347+
* Java regular expression flags. Flags should be pipe-separated, eg "CASE_INSENSITIVE|COMMENTS".
348+
*/
349+
flags?: string // TODO: Use PipeSeparatedFlags<T> and proper enum
350+
/**
351+
* Should terms be lowercased or not.
352+
* Defaults to `true`.
353+
*
354+
* @server_default true
355+
*/
324356
lowercase?: boolean
325-
pattern: string
326-
stopwords?: StopWords
357+
/**
358+
* A Java regular expression.
359+
* Defaults to `\W+`.
360+
*
361+
* @server_default \W+
362+
*/
363+
pattern?: string
364+
/**
365+
* A pre-defined stop words list like `_english_` or an array containing a list of stop words.
366+
* Defaults to `_none_`.
367+
*
368+
* @server_default _none_
369+
*/
370+
stopwords?: StopWords
371+
/**
372+
* The path to a file containing stop words.
373+
*/
374+
stopwords_path?: string
327375
}
328376

329377
export class SimpleAnalyzer {
330378
type: 'simple'
379+
/** @deprecated 7.14.0 */
331380
version?: VersionString
332381
}
333382

383+
// TODO: This one seems undocumented!?
334384
export class SnowballAnalyzer {
335385
type: 'snowball'
386+
/** @deprecated 7.14.0 */
336387
version?: VersionString
337388
language: SnowballLanguage
338389
stopwords?: StopWords
339390
}
340391

341392
export class StandardAnalyzer {
342393
type: 'standard'
394+
/**
395+
* The maximum token length. If a token is seen that exceeds this length then it is split at `max_token_length` intervals.
396+
* Defaults to `255`.
397+
*
398+
* @server_default 255
399+
*/
343400
max_token_length?: integer
401+
/**
402+
* A pre-defined stop words list like `_english_` or an array containing a list of stop words.
403+
* Defaults to `_none_`.
404+
*
405+
* @server_default _none_
406+
*/
344407
stopwords?: StopWords
408+
/**
409+
* The path to a file containing stop words.
410+
*/
411+
stopwords_path?: string
345412
}
346413

347414
export class StopAnalyzer {
348415
type: 'stop'
416+
/** @deprecated 7.14.0 */
349417
version?: VersionString
418+
/**
419+
* A pre-defined stop words list like `_english_` or an array containing a list of stop words.
420+
* Defaults to `_none_`.
421+
*
422+
* @server_default _none_
423+
*/
350424
stopwords?: StopWords
425+
/**
426+
* The path to a file containing stop words.
427+
*/
351428
stopwords_path?: string
352429
}
353430

354431
export class WhitespaceAnalyzer {
355432
type: 'whitespace'
433+
/** @deprecated 7.14.0 */
356434
version?: VersionString
357435
}
358436

specification/_types/query_dsl/span.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
import { SingleKeyDictionary } from '@spec_utils/Dictionary'
21-
import { Field } from '@_types/common'
21+
import { Field, FieldValue } from '@_types/common'
2222
import { integer } from '@_types/Numeric'
2323
import { QueryBase, QueryContainer } from './abstractions'
2424

@@ -136,7 +136,8 @@ export class SpanOrQuery extends QueryBase {
136136
* @ext_doc_id query-dsl-span-term-query
137137
*/
138138
export class SpanTermQuery extends QueryBase {
139-
value: string
139+
/** @aliases term */
140+
value: FieldValue
140141
}
141142

142143
/**

specification/_types/query_dsl/specialized.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export class PinnedDoc {
274274
/**
275275
* The index that contains the document.
276276
*/
277-
_index: IndexName
277+
_index?: IndexName
278278
}
279279

280280
export class RankFeatureFunction {}

specification/graph/_types/Hop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class Hop {
2828
/**
2929
* An optional guiding query that constrains the Graph API as it explores connected terms.
3030
*/
31-
query: QueryContainer
31+
query?: QueryContainer
3232
/**
3333
* Contains the fields you are interested in.
3434
*/

specification/graph/_types/Vertex.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ export class VertexDefinition {
5858
size?: integer
5959
}
6060

61+
/** @shortcut_property term */
6162
export class VertexInclude {
62-
boost: double
63+
boost?: double
6364
term: string
6465
}

specification/ingest/_types/Processors.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
2222
import { Field, Fields, GrokPattern, Id, Name } from '@_types/common'
2323
import { GeoShapeRelation } from '@_types/Geo'
2424
import { double, integer, long } from '@_types/Numeric'
25+
import { Script } from '@_types/Scripting'
2526
import { SortOrder } from '@_types/sort'
2627

2728
/**
@@ -309,7 +310,7 @@ export class ProcessorBase {
309310
/**
310311
* Conditionally execute the processor.
311312
*/
312-
if?: string
313+
if?: Script
313314
/**
314315
* Ignore failures for the processor.
315316
*/
@@ -731,7 +732,7 @@ export class DateIndexNameProcessor extends ProcessorBase {
731732
* An array of the expected date formats for parsing dates / timestamps in the document being preprocessed.
732733
* Can be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.
733734
*/
734-
date_formats: string[]
735+
date_formats?: string[]
735736
/**
736737
* How to round the date when formatting the date into the index name. Valid values are:
737738
* `y` (year), `M` (month), `w` (week), `d` (day), `h` (hour), `m` (minute) and `s` (second).

specification/ml/_types/DataframeAnalytics.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ export class DataframeAnalysisClassification extends DataframeAnalysis {
238238
/** @shortcut_property includes */
239239
export class DataframeAnalysisAnalyzedFields {
240240
/** An array of strings that defines the fields that will be excluded from the analysis. You do not need to add fields with unsupported data types to excludes, these fields are excluded from the analysis automatically. */
241-
includes: string[]
241+
includes?: string[]
242242
/** An array of strings that defines the fields that will be included in the analysis. */
243-
excludes: string[]
243+
excludes?: string[]
244244
}
245245

246246
/** @variants container */

specification/snapshot/_types/SnapshotRepository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class AzureRepository extends RepositoryBase {
4646
/**
4747
* The repository settings.
4848
*/
49-
settings: AzureRepositorySettings
49+
settings?: AzureRepositorySettings
5050
}
5151

5252
export class GcsRepository extends RepositoryBase {
File renamed without changes.

specification/sql/get_async/SqlGetAsyncResponse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
import { Id } from '@_types/common'
21-
import { Column, Row } from '../types'
21+
import { Column, Row } from '../_types/types'
2222

2323
export class Response {
2424
body: {

specification/sql/query/QuerySqlResponse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
import { Id } from '@_types/common'
21-
import { Column, Row } from '../types'
21+
import { Column, Row } from '../_types/types'
2222

2323
export class Response {
2424
body: {

0 commit comments

Comments
 (0)