Skip to content
Open
Show file tree
Hide file tree
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
12 changes: 8 additions & 4 deletions specification/_global/get/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@
* under the License.
*/

import { Id, IndexName, SequenceNumber, VersionNumber } from '@_types/common'
import {
Id,
IndexName,
SequenceNumber,
UserDefinedObject,
VersionNumber
} from '@_types/common'
import { long } from '@_types/Numeric'
import { Dictionary } from '@spec_utils/Dictionary'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'

export class GetResult<TDocument> {
/**
Expand All @@ -30,7 +34,7 @@ export class GetResult<TDocument> {
/**
* If the `stored_fields` parameter is set to `true` and `found` is `true`, it contains the document fields stored in the index.
*/
fields?: Dictionary<string, UserDefinedValue>
fields?: UserDefinedObject
_ignored?: string[]
/**
* Indicates whether the document exists.
Expand Down
11 changes: 8 additions & 3 deletions specification/_global/search/SearchResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@
*/

import { Aggregate } from '@_types/aggregations/Aggregate'
import { AggregateName, Id, ScrollId, SuggestionName } from '@_types/common'
import {
AggregateName,
Id,
ScrollId,
SuggestionName,
UserDefinedObject
} from '@_types/common'
import { double, long } from '@_types/Numeric'
import { ClusterStatistics, ShardStatistics } from '@_types/Stats'
import { Dictionary } from '@spec_utils/Dictionary'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
import { HitsMetadata } from './_types/hits'
import { Profile } from './_types/profile'
import { Suggest } from './_types/suggester'
Expand Down Expand Up @@ -68,7 +73,7 @@ export class ResponseBody<TDocument> {
hits: HitsMetadata<TDocument>
aggregations?: Dictionary<AggregateName, Aggregate>
_clusters?: ClusterStatistics
fields?: Dictionary<string, UserDefinedValue>
fields?: UserDefinedObject
max_score?: double
num_reduce_phases?: long
profile?: Profile
Expand Down
3 changes: 2 additions & 1 deletion specification/_global/search/_types/hits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
IndexName,
Name,
SequenceNumber,
UserDefinedObject,
VersionNumber
} from '@_types/common'
import { double, integer, long } from '@_types/Numeric'
Expand All @@ -49,7 +50,7 @@ export class Hit<TDocument> {
// See https://github.com/elastic/elasticsearch-specification/pull/5248
_score?: double | null
_explanation?: Explanation
fields?: Dictionary<string, UserDefinedValue>
fields?: UserDefinedObject
highlight?: Dictionary<string, string[]>
inner_hits?: Dictionary<string, InnerHitsResult>
matched_queries?: string[] | Dictionary<string, double>
Expand Down
5 changes: 3 additions & 2 deletions specification/_global/search/_types/suggester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import {
Id,
IndexName,
Routing,
SuggestMode
SuggestMode,
UserDefinedObject
} from '@_types/common'
import { GeoHashPrecision, GeoLocation } from '@_types/Geo'
import { double, float, integer, long } from '@_types/Numeric'
Expand Down Expand Up @@ -74,7 +75,7 @@ export class TermSuggest extends SuggestBase {
export class CompletionSuggestOption<TDocument> {
collate_match?: boolean
contexts?: Dictionary<string, Context[]>
fields?: Dictionary<string, UserDefinedValue>
fields?: UserDefinedObject
_id?: string
_index?: IndexName
_routing?: Routing
Expand Down
11 changes: 8 additions & 3 deletions specification/_global/search_template/SearchTemplateResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,19 @@
*/

import { Aggregate } from '@_types/aggregations/Aggregate'
import { AggregateName, Id, ScrollId, SuggestionName } from '@_types/common'
import {
AggregateName,
Id,
ScrollId,
SuggestionName,
UserDefinedObject
} from '@_types/common'
import { double, long } from '@_types/Numeric'
import { ClusterStatistics, ShardStatistics } from '@_types/Stats'
import { HitsMetadata } from '@global/search/_types/hits'
import { Profile } from '@global/search/_types/profile'
import { Suggest } from '@global/search/_types/suggester'
import { Dictionary } from '@spec_utils/Dictionary'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'

export class Response<TDocument> {
body: {
Expand All @@ -36,7 +41,7 @@ export class Response<TDocument> {
hits: HitsMetadata<TDocument>
aggregations?: Dictionary<AggregateName, Aggregate>
_clusters?: ClusterStatistics
fields?: Dictionary<string, UserDefinedValue>
fields?: UserDefinedObject
max_score?: double
num_reduce_phases?: long
profile?: Profile
Expand Down
3 changes: 2 additions & 1 deletion specification/_types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export type DataStreamNames = DataStreamName | DataStreamName[]
/** @doc_id byte-units */
export type ByteSize = long | string

export type UserDefinedObject = Dictionary<string, UserDefinedValue>
export type Metadata = Dictionary<string, UserDefinedValue>

// Versioning Numbers & Strings
Expand Down Expand Up @@ -328,7 +329,7 @@ export enum WaitForEvents {
export class InlineGet<TDocument>
implements AdditionalProperties<string, UserDefinedValue>
{
fields?: Dictionary<string, UserDefinedValue>
fields?: UserDefinedObject
found: boolean
_seq_no?: SequenceNumber
_primary_term?: long
Expand Down
11 changes: 8 additions & 3 deletions specification/async_search/_types/AsyncSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,27 @@
*/

import { Aggregate } from '@_types/aggregations/Aggregate'
import { AggregateName, Id, ScrollId, SuggestionName } from '@_types/common'
import {
AggregateName,
Id,
ScrollId,
SuggestionName,
UserDefinedObject
} from '@_types/common'
import { double, long } from '@_types/Numeric'
import { ClusterStatistics, ShardStatistics } from '@_types/Stats'
import { HitsMetadata } from '@global/search/_types/hits'
import { Profile } from '@global/search/_types/profile'
import { Suggest } from '@global/search/_types/suggester'
import { Dictionary } from '@spec_utils/Dictionary'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'

export class AsyncSearch<TDocument> {
/**
* Partial aggregations results, coming from the shards that have already completed running the query.
*/
aggregations?: Dictionary<AggregateName, Aggregate>
_clusters?: ClusterStatistics
fields?: Dictionary<string, UserDefinedValue>
fields?: UserDefinedObject
hits: HitsMetadata<TDocument>
max_score?: double
/**
Expand Down
11 changes: 8 additions & 3 deletions specification/fleet/search/SearchResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,19 @@
*/

import { Aggregate } from '@_types/aggregations/Aggregate'
import { AggregateName, Id, ScrollId, SuggestionName } from '@_types/common'
import {
AggregateName,
Id,
ScrollId,
SuggestionName,
UserDefinedObject
} from '@_types/common'
import { double, long } from '@_types/Numeric'
import { ClusterStatistics, ShardStatistics } from '@_types/Stats'
import { HitsMetadata } from '@global/search/_types/hits'
import { Profile } from '@global/search/_types/profile'
import { Suggest } from '@global/search/_types/suggester'
import { Dictionary } from '@spec_utils/Dictionary'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'

// Keep changes in sync with:
// - search
Expand All @@ -38,7 +43,7 @@ export class Response<TDocument> {
hits: HitsMetadata<TDocument>
aggregations?: Dictionary<AggregateName, Aggregate>
_clusters?: ClusterStatistics
fields?: Dictionary<string, UserDefinedValue>
fields?: UserDefinedObject
max_score?: double
num_reduce_phases?: long
profile?: Profile
Expand Down
12 changes: 9 additions & 3 deletions specification/ingest/_types/Simulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@
* under the License.
*/

import { Id, IndexName, Name, VersionNumber, VersionType } from '@_types/common'
import {
Id,
IndexName,
Name,
UserDefinedObject,
VersionNumber,
VersionType
} from '@_types/common'
import { ErrorCause } from '@_types/Errors'
import { DateTime } from '@_types/Time'
import { AdditionalProperties } from '@spec_utils/behaviors'
import { Dictionary } from '@spec_utils/Dictionary'
import { Stringified } from '@spec_utils/Stringified'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'

Expand Down Expand Up @@ -106,7 +112,7 @@ export class DocumentSimulation
/**
* JSON body for the document.
*/
_source: Dictionary<string, UserDefinedValue>
_source: UserDefinedObject
/**
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@
*/

import { RequestBase } from '@_types/Base'
import { Id } from '@_types/common'
import { Id, UserDefinedObject } from '@_types/common'
import { Duration } from '@_types/Time'
import { InferenceConfigUpdateContainer } from '@ml/_types/inference'
import { Dictionary } from '@spec_utils/Dictionary'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'

/**
* Evaluate a trained model.
Expand Down Expand Up @@ -58,7 +56,7 @@ export interface Request extends RequestBase {
* configured trained model input. Typically, for NLP models, the field name is `text_field`.
* Currently, for NLP models, only a single value is allowed.
*/
docs: Dictionary<string, UserDefinedValue>[]
docs: UserDefinedObject[]
/**
* The inference configuration updates to apply on the API call
*/
Expand Down
5 changes: 2 additions & 3 deletions specification/simulate/ingest/SimulateIngestResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
* under the License.
*/

import { Id, IndexName, VersionNumber } from '@_types/common'
import { Id, IndexName, UserDefinedObject, VersionNumber } from '@_types/common'
import { ErrorCause } from '@_types/Errors'
import { TypeMapping } from '@_types/mapping/TypeMapping'
import { AdditionalProperties } from '@spec_utils/behaviors'
import { Dictionary } from '@spec_utils/Dictionary'
import { Stringified } from '@spec_utils/Stringified'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'

export class Response {
body: { docs: SimulateIngestDocumentResult[] }
Expand Down Expand Up @@ -55,7 +54,7 @@ export class IngestDocumentSimulation
/**
* JSON body for the document.
*/
_source: Dictionary<string, UserDefinedValue>
_source: UserDefinedObject
/**
*
*/
Expand Down
Loading