Skip to content
8 changes: 4 additions & 4 deletions specification/_types/analysis/icu-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ export class IcuFoldingTokenFilter extends TokenFilterBase {
export class IcuCollationTokenFilter extends TokenFilterBase {
type: 'icu_collation'
alternate?: IcuCollationAlternate
case_first?: IcuCollationCaseFirst
case_level?: boolean
caseFirst?: IcuCollationCaseFirst
caseLevel?: boolean
country?: string
decomposition?: IcuCollationDecomposition
hiragana_quaternary_mode?: boolean
hiraganaQuaternaryMode?: boolean
language?: string
numeric?: boolean
rules?: string
strength?: IcuCollationStrength
variable_top?: string
variableTop?: string
variant?: string
}

Expand Down
43 changes: 42 additions & 1 deletion specification/_types/analysis/token_filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export class HunspellTokenFilter extends TokenFilterBase {
dictionary?: string
/** Locale directory used to specify the `.aff` and `.dic` files for a Hunspell dictionary.
* @aliases lang, language */
locale: string
locale?: string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HunspellTokenFilter: locale has two aliases, and if it's set as mandatory as it was before, this means that the generator will generate 3 mandatory fields. For now I'm setting this as optional, but maybe we should support this as a feature?

Which generator? I think we should discuss this before making it wrongly optional

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah sorry wrong wording, I mean the ts compiler. if you look at

export interface AnalysisHunspellTokenFilter extends AnalysisTokenFilterBase {
you'll see the generated output

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right aliases seem to be a recipe for problem, as their generation is pretty naive. I added a comment to #4599 (comment) to mention it. In the meantime, making this optional just because we can't handle it still seems wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, reverting then

/** If `true`, only the longest stemmed version of each token is included in the output. If `false`, all stemmed versions of the token are included. Defaults to `false`. */
longest_only?: boolean
}
Expand Down Expand Up @@ -383,6 +383,7 @@ export class PatternReplaceTokenFilter extends TokenFilterBase {
type: 'pattern_replace'
/** If `true`, all substrings matching the pattern parameter’s regular expression are replaced. If `false`, the filter replaces only the first matching substring in each token. Defaults to `true`. */
all?: boolean
flags?: string
/** Regular expression, written in Java’s regular expression syntax. The filter replaces token substrings matching this pattern with the substring in the `replacement` parameter. */
pattern: string
/** Replacement substring. Defaults to an empty substring (`""`). */
Expand Down Expand Up @@ -486,6 +487,14 @@ export class FlattenGraphTokenFilter extends TokenFilterBase {
type: 'flatten_graph'
}

export class BengaliNormalizationTokenFilter extends TokenFilterBase {
type: 'bengali_normalization'
}

export class BrazilianNormalizationTokenFilter extends TokenFilterBase {
type: 'brazilian_stem'
}

export class GermanNormalizationTokenFilter extends TokenFilterBase {
type: 'german_normalization'
}
Expand Down Expand Up @@ -535,6 +544,30 @@ export class SoraniNormalizationTokenFilter extends TokenFilterBase {
type: 'sorani_normalization'
}

export class ArabicStemTokenFilter extends TokenFilterBase {
type: 'arabic_stem'
}

export class CzechStemTokenFilter extends TokenFilterBase {
type: 'czech_stem'
}

export class FrenchStemTokenFilter extends TokenFilterBase {
type: 'french_stem'
}

export class DutchStemTokenFilter extends TokenFilterBase {
type: 'dutch_stem'
}

export class GermanStemTokenFilter extends TokenFilterBase {
type: 'german_stem'
}

export class RussianStemTokenFilter extends TokenFilterBase {
type: 'russian_stem'
}

/**
* @codegen_names name, definition
* @ext_doc_id analysis-tokenfilters
Expand All @@ -548,20 +581,27 @@ export type TokenFilter = string | TokenFilterDefinition
*/
export type TokenFilterDefinition =
| ApostropheTokenFilter
| ArabicStemTokenFilter
| ArabicNormalizationTokenFilter
| AsciiFoldingTokenFilter
| BengaliNormalizationTokenFilter
| BrazilianNormalizationTokenFilter
| CjkBigramTokenFilter
| CjkWidthTokenFilter
| ClassicTokenFilter
| CommonGramsTokenFilter
| ConditionTokenFilter
| CzechStemTokenFilter
| DecimalDigitTokenFilter
| DelimitedPayloadTokenFilter
| DutchStemTokenFilter
| EdgeNGramTokenFilter
| ElisionTokenFilter
| FingerprintTokenFilter
| FlattenGraphTokenFilter
| FrenchStemTokenFilter
| GermanNormalizationTokenFilter
| GermanStemTokenFilter
| HindiNormalizationTokenFilter
| HunspellTokenFilter
| HyphenationDecompounderTokenFilter
Expand All @@ -585,6 +625,7 @@ export type TokenFilterDefinition =
| PredicateTokenFilter
| RemoveDuplicatesTokenFilter
| ReverseTokenFilter
| RussianStemTokenFilter
| ScandinavianFoldingTokenFilter
| ScandinavianNormalizationTokenFilter
| SerbianNormalizationTokenFilter
Expand Down
5 changes: 1 addition & 4 deletions specification/_types/analysis/tokenizers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ export class EdgeNGramTokenizer extends TokenizerBase {
custom_token_chars?: string
max_gram?: integer
min_gram?: integer
/**
* @server_default []
*/
token_chars?: TokenChar[]
token_chars?: string | TokenChar[]
}

export enum TokenChar {
Expand Down
2 changes: 2 additions & 0 deletions specification/_types/mapping/Property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import {
PercolatorProperty,
RankFeatureProperty,
RankFeaturesProperty,
RankVectorProperty,
ScaledFloatNumberProperty,
SearchAsYouTypeProperty,
SemanticTextProperty,
Expand Down Expand Up @@ -147,6 +148,7 @@ export type Property =
| NestedProperty
| ObjectProperty
| PassthroughObjectProperty
| RankVectorProperty
| SemanticTextProperty
| SparseVectorProperty

Expand Down
2 changes: 2 additions & 0 deletions specification/_types/mapping/complex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class FlattenedProperty extends PropertyBase {
null_value?: string
similarity?: string
split_queries_on_whitespace?: boolean
time_series_dimensions?: string[]
type: 'flattened'
}

Expand All @@ -59,6 +60,7 @@ export class PassthroughObjectProperty extends CorePropertyBase {
export class AggregateMetricDoubleProperty extends PropertyBase {
type: 'aggregate_metric_double'
default_metric: string
ignore_malformed?: boolean
metrics: string[]
time_series_metric?: TimeSeriesMetricType
}
13 changes: 13 additions & 0 deletions specification/_types/mapping/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,14 @@ export class RankFeaturesProperty extends PropertyBase {
type: 'rank_features'
}

export class RankVectorProperty extends PropertyBase {
type: 'rank_vectors'
element_type?: RankVectorElementType
dims?: integer
}

Comment on lines +220 to +225
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a technical preview feature, how can we specify it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this work? since type is the internal tag

export class RankVectorProperty extends PropertyBase {
  /**
   * @availability stack since=8.18.0 stability=experimental
   */
  type: 'rank_vectors'
  element_type?: RankVectorElementType
  dims?: integer
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I don't think that is possible today, see #2830. Leaving this for future work then.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment at least?

export class SparseVectorProperty extends PropertyBase {
store?: boolean
type: 'sparse_vector'
}

Expand Down Expand Up @@ -364,3 +371,9 @@ export class DynamicProperty extends DocValuesPropertyBase {
precision_step?: integer
locale?: string
}

export enum RankVectorElementType {
byte,
float,
bit
}
7 changes: 7 additions & 0 deletions specification/_types/mapping/geo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ export class GeoPointProperty extends DocValuesPropertyBase {
on_script_error?: OnScriptError
script?: Script
type: 'geo_point'
time_series_metric?: GeoPointMetricType
}

export enum GeoPointMetricType {
gauge,
counter,
position
}

export enum GeoOrientation {
Expand Down
33 changes: 2 additions & 31 deletions specification/indices/_types/IndexSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,44 +534,15 @@ export class SlowlogTresholdLevels {
}

export class Storage {
type: StorageType
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/**
* You can restrict the use of the mmapfs and the related hybridfs store type via the setting node.store.allow_mmap.
* This is a boolean setting indicating whether or not memory-mapping is allowed. The default is to allow it. This
* setting is useful, for example, if you are in an environment where you can not control the ability to create a lot
* of memory maps so you need disable the ability to use memory-mapping.
*/
allow_mmap?: boolean
}

/**
* @non_exhaustive
*/
export enum StorageType {
/**
* Default file system implementation. This will pick the best implementation depending on the operating environment, which
* is currently hybridfs on all supported systems but is subject to change.
*/
fs,
/**
* The NIO FS type stores the shard index on the file system (maps to Lucene NIOFSDirectory) using NIO. It allows multiple
* threads to read from the same file concurrently. It is not recommended on Windows because of a bug in the SUN Java
* implementation and disables some optimizations for heap memory usage.
*/
niofs,
/**
* The MMap FS type stores the shard index on the file system (maps to Lucene MMapDirectory) by mapping a file into
* memory (mmap). Memory mapping uses up a portion of the virtual memory address space in your process equal to the size
* of the file being mapped. Before using this class, be sure you have allowed plenty of virtual address space.
*/
mmapfs,
/**
* The hybridfs type is a hybrid of niofs and mmapfs, which chooses the best file system type for each type of file
* based on the read access pattern. Currently only the Lucene term dictionary, norms and doc values files are memory
* mapped. All other files are opened using Lucene NIOFSDirectory. Similarly to mmapfs be sure you have allowed
* plenty of virtual address space.
*/
hybridfs
/** How often store statistics are refreshed */
stats_refresh_interval?: Duration
}

export class IndexingPressure {
Expand Down