Skip to content

[7.17] Start of fixes for core/search (#1947) #1957

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

Merged
merged 1 commit into from
Oct 11, 2022
Merged
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
308 changes: 178 additions & 130 deletions output/schema/schema.json

Large diffs are not rendered by default.

26 changes: 16 additions & 10 deletions output/typescript/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 33 additions & 2 deletions specification/_global/field_caps/FieldCapabilitiesRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,49 @@ import { QueryContainer } from '@_types/query_dsl/abstractions'
*/
export interface Request extends RequestBase {
path_parts: {
/**
* Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.
*/
index?: Indices
}
query_parameters: {
/**
* If false, the request returns an error if any wildcard expression, index alias,
* or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request
* targeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar.
* @server_default true
*/
allow_no_indices?: boolean
/**
* Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as `open,hidden`.
* @server_default open
*/
expand_wildcards?: ExpandWildcards
fields: Fields
/**
* Comma-separated list of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported.
*/
fields?: Fields
/**
* If `true`, missing or closed indices are not included in the response.
* @server_default false
*/
ignore_unavailable?: boolean
/**
* If true, unmapped fields are included in the response.
* @server_default false
*/
include_unmapped?: boolean
}
body: {
/**
* Allows to filter indices if the provided query rewrites to match_none on every shard.
*/
index_filter?: QueryContainer
/** @since 7.12.0 */
/**
* Defines ad-hoc runtime fields in the request similar to the way it is done in search requests.
* These fields exist only as part of the query and take precedence over fields defined with the same name in the index mappings.
* @since 7.12.0
*/
runtime_mappings?: RuntimeFields
}
}
2 changes: 2 additions & 0 deletions specification/_global/search/_types/highlighting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { Field, Fields } from '@_types/common'
import { integer } from '@_types/Numeric'
import { QueryContainer } from '@_types/query_dsl/abstractions'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
import { Analyzer } from '@_types/analysis/analyzers'

export enum BoundaryScanner {
chars = 0,
Expand Down Expand Up @@ -89,4 +90,5 @@ export enum BuiltinHighlighterType {
export class HighlightField extends HighlightBase {
fragment_offset?: integer
matched_fields?: Fields
analyzer?: Analyzer
}
4 changes: 4 additions & 0 deletions specification/_global/search/_types/hits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ import { Sort, SortResults } from '@_types/sort'

export class Hit<TDocument> {
_index: IndexName
/**
* @es_quirk '_id' is not available when using 'stored_fields: _none_'
* on a search request. Otherwise the field is always present on hits.
*/
_id: Id

_score?: double
Expand Down
2 changes: 2 additions & 0 deletions specification/_global/search/_types/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ export class FetchProfile {
}

export class FetchProfileBreakdown {
load_source?: integer
load_source_count?: integer
load_stored_fields?: integer
load_stored_fields_count?: integer
next_reader?: integer
Expand Down
6 changes: 5 additions & 1 deletion specification/_types/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ export class NodeAttributes {
/** The ephemeral ID of the node. */
ephemeral_id: Id
/** The unique identifier of the node. */
id?: Id
id?: NodeId
/** The unique identifier of the node. */
name: NodeName
/** The host and port where transport HTTP connections are accepted. */
transport_address: TransportAddress
roles?: NodeRoles
/**
* @since 8.3.0
*/
external_id: string
}

export class NodeShard {
Expand Down
4 changes: 2 additions & 2 deletions specification/_types/SlicedScroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
* under the License.
*/

import { Field } from './common'
import { Field, Id } from './common'
import { integer } from './Numeric'

export class SlicedScroll {
field?: Field
id: integer
id: Id
max: integer
}
15 changes: 9 additions & 6 deletions specification/_types/aggregations/Aggregate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,15 @@ export class AdjacencyMatrixBucket extends MultiBucketBase {
key: string
}

export class SignificantTermsAggregateBase<
T
> extends MultiBucketAggregateBase<T> {
bg_count: long
}

/** @variant name=siglterms */
// ES: SignificantLongTerms & InternalSignificantTerms
export class SignificantLongTermsAggregate extends MultiBucketAggregateBase<SignificantLongTermsBucket> {}
export class SignificantLongTermsAggregate extends SignificantTermsAggregateBase<SignificantLongTermsBucket> {}

export class SignificantTermsBucketBase extends MultiBucketBase {
score: double
Expand All @@ -577,10 +583,7 @@ export class SignificantLongTermsBucket extends SignificantTermsBucketBase {

/** @variant name=sigsterms */
// ES: SignificantStringTerms & InternalSignificantTerms
export class SignificantStringTermsAggregate extends MultiBucketAggregateBase<SignificantStringTermsBucket> {
bg_count?: long
doc_count?: long
}
export class SignificantStringTermsAggregate extends SignificantTermsAggregateBase<SignificantStringTermsBucket> {}

export class SignificantStringTermsBucket extends SignificantTermsBucketBase {
key: string
Expand All @@ -592,7 +595,7 @@ export class SignificantStringTermsBucket extends SignificantTermsBucketBase {
*/
// ES: UnmappedSignificantTerms
// See note in UnmappedTermsAggregate
export class UnmappedSignificantTermsAggregate extends MultiBucketAggregateBase<Void> {}
export class UnmappedSignificantTermsAggregate extends SignificantTermsAggregateBase<Void> {}

/** @variant name=composite */
// Note: no keyed variant
Expand Down
8 changes: 5 additions & 3 deletions specification/_types/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
*/

import { AdditionalProperty } from '@spec_utils/behaviors'
import { Dictionary } from '@spec_utils/Dictionary'
import { Missing } from '@_types/aggregations/AggregationContainer'
import { Field } from '@_types/common'
import { Field, FieldValue } from '@_types/common'
import { DistanceUnit, GeoDistanceType, GeoLocation } from '@_types/Geo'
import { FieldType } from '@_types/mapping/Property'
import { double, integer, long } from '@_types/Numeric'
Expand Down Expand Up @@ -74,7 +75,8 @@ export class ScriptSort {

export enum ScriptSortType {
string,
number
number,
version
}

/**
Expand All @@ -96,7 +98,7 @@ export type SortCombinations = Field | SortOptions

export type Sort = SortCombinations | SortCombinations[]

export type SortResults = Array<long | double | string | null>
export type SortResults = FieldValue[]

/**
* Defines what values to pick in the case a document contains multiple values for a particular field.
Expand Down