Skip to content

Commit 6e5cc35

Browse files
swallezsethmlarson
andauthored
Start of fixes for core/search (#1947) (#1957)
Co-authored-by: Seth Michael Larson <[email protected]>
1 parent aa86cda commit 6e5cc35

File tree

10 files changed

+256
-154
lines changed

10 files changed

+256
-154
lines changed

output/schema/schema.json

Lines changed: 178 additions & 130 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: 16 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_global/field_caps/FieldCapabilitiesRequest.ts

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,49 @@ import { QueryContainer } from '@_types/query_dsl/abstractions'
2929
*/
3030
export interface Request extends RequestBase {
3131
path_parts: {
32+
/**
33+
* 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.
34+
*/
3235
index?: Indices
3336
}
3437
query_parameters: {
38+
/**
39+
* If false, the request returns an error if any wildcard expression, index alias,
40+
* or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request
41+
* targeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar.
42+
* @server_default true
43+
*/
3544
allow_no_indices?: boolean
45+
/**
46+
* 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`.
47+
* @server_default open
48+
*/
3649
expand_wildcards?: ExpandWildcards
37-
fields: Fields
50+
/**
51+
* Comma-separated list of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported.
52+
*/
53+
fields?: Fields
54+
/**
55+
* If `true`, missing or closed indices are not included in the response.
56+
* @server_default false
57+
*/
3858
ignore_unavailable?: boolean
59+
/**
60+
* If true, unmapped fields are included in the response.
61+
* @server_default false
62+
*/
3963
include_unmapped?: boolean
4064
}
4165
body: {
66+
/**
67+
* Allows to filter indices if the provided query rewrites to match_none on every shard.
68+
*/
4269
index_filter?: QueryContainer
43-
/** @since 7.12.0 */
70+
/**
71+
* Defines ad-hoc runtime fields in the request similar to the way it is done in search requests.
72+
* These fields exist only as part of the query and take precedence over fields defined with the same name in the index mappings.
73+
* @since 7.12.0
74+
*/
4475
runtime_mappings?: RuntimeFields
4576
}
4677
}

specification/_global/search/_types/highlighting.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { Field, Fields } from '@_types/common'
2222
import { integer } from '@_types/Numeric'
2323
import { QueryContainer } from '@_types/query_dsl/abstractions'
2424
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
25+
import { Analyzer } from '@_types/analysis/analyzers'
2526

2627
export enum BoundaryScanner {
2728
chars = 0,
@@ -89,4 +90,5 @@ export enum BuiltinHighlighterType {
8990
export class HighlightField extends HighlightBase {
9091
fragment_offset?: integer
9192
matched_fields?: Fields
93+
analyzer?: Analyzer
9294
}

specification/_global/search/_types/hits.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ import { Sort, SortResults } from '@_types/sort'
4040

4141
export class Hit<TDocument> {
4242
_index: IndexName
43+
/**
44+
* @es_quirk '_id' is not available when using 'stored_fields: _none_'
45+
* on a search request. Otherwise the field is always present on hits.
46+
*/
4347
_id: Id
4448

4549
_score?: double

specification/_global/search/_types/profile.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ export class FetchProfile {
147147
}
148148

149149
export class FetchProfileBreakdown {
150+
load_source?: integer
151+
load_source_count?: integer
150152
load_stored_fields?: integer
151153
load_stored_fields_count?: integer
152154
next_reader?: integer

specification/_types/Node.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,16 @@ export class NodeAttributes {
4141
/** The ephemeral ID of the node. */
4242
ephemeral_id: Id
4343
/** The unique identifier of the node. */
44-
id?: Id
44+
id?: NodeId
4545
/** The unique identifier of the node. */
4646
name: NodeName
4747
/** The host and port where transport HTTP connections are accepted. */
4848
transport_address: TransportAddress
4949
roles?: NodeRoles
50+
/**
51+
* @since 8.3.0
52+
*/
53+
external_id: string
5054
}
5155

5256
export class NodeShard {

specification/_types/SlicedScroll.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
* under the License.
1818
*/
1919

20-
import { Field } from './common'
20+
import { Field, Id } from './common'
2121
import { integer } from './Numeric'
2222

2323
export class SlicedScroll {
2424
field?: Field
25-
id: integer
25+
id: Id
2626
max: integer
2727
}

specification/_types/aggregations/Aggregate.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,15 @@ export class AdjacencyMatrixBucket extends MultiBucketBase {
561561
key: string
562562
}
563563

564+
export class SignificantTermsAggregateBase<
565+
T
566+
> extends MultiBucketAggregateBase<T> {
567+
bg_count: long
568+
}
569+
564570
/** @variant name=siglterms */
565571
// ES: SignificantLongTerms & InternalSignificantTerms
566-
export class SignificantLongTermsAggregate extends MultiBucketAggregateBase<SignificantLongTermsBucket> {}
572+
export class SignificantLongTermsAggregate extends SignificantTermsAggregateBase<SignificantLongTermsBucket> {}
567573

568574
export class SignificantTermsBucketBase extends MultiBucketBase {
569575
score: double
@@ -577,10 +583,7 @@ export class SignificantLongTermsBucket extends SignificantTermsBucketBase {
577583

578584
/** @variant name=sigsterms */
579585
// ES: SignificantStringTerms & InternalSignificantTerms
580-
export class SignificantStringTermsAggregate extends MultiBucketAggregateBase<SignificantStringTermsBucket> {
581-
bg_count?: long
582-
doc_count?: long
583-
}
586+
export class SignificantStringTermsAggregate extends SignificantTermsAggregateBase<SignificantStringTermsBucket> {}
584587

585588
export class SignificantStringTermsBucket extends SignificantTermsBucketBase {
586589
key: string
@@ -592,7 +595,7 @@ export class SignificantStringTermsBucket extends SignificantTermsBucketBase {
592595
*/
593596
// ES: UnmappedSignificantTerms
594597
// See note in UnmappedTermsAggregate
595-
export class UnmappedSignificantTermsAggregate extends MultiBucketAggregateBase<Void> {}
598+
export class UnmappedSignificantTermsAggregate extends SignificantTermsAggregateBase<Void> {}
596599

597600
/** @variant name=composite */
598601
// Note: no keyed variant

specification/_types/sort.ts

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

2020
import { AdditionalProperty } from '@spec_utils/behaviors'
21+
import { Dictionary } from '@spec_utils/Dictionary'
2122
import { Missing } from '@_types/aggregations/AggregationContainer'
22-
import { Field } from '@_types/common'
23+
import { Field, FieldValue } from '@_types/common'
2324
import { DistanceUnit, GeoDistanceType, GeoLocation } from '@_types/Geo'
2425
import { FieldType } from '@_types/mapping/Property'
2526
import { double, integer, long } from '@_types/Numeric'
@@ -74,7 +75,8 @@ export class ScriptSort {
7475

7576
export enum ScriptSortType {
7677
string,
77-
number
78+
number,
79+
version
7880
}
7981

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

9799
export type Sort = SortCombinations | SortCombinations[]
98100

99-
export type SortResults = Array<long | double | string | null>
101+
export type SortResults = FieldValue[]
100102

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

0 commit comments

Comments
 (0)