Skip to content

Commit 1ddfff9

Browse files
Start of fixes for core/search (#1947) (#1956)
Co-authored-by: Seth Michael Larson <[email protected]>
1 parent 4dd845c commit 1ddfff9

File tree

10 files changed

+232
-148
lines changed

10 files changed

+232
-148
lines changed

output/schema/schema.json

Lines changed: 180 additions & 125 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: 17 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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export interface Request extends RequestBase {
5454
/**
5555
* Comma-separated list of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported.
5656
*/
57-
fields: Fields
57+
fields?: Fields
5858
/**
5959
* If `true`, missing or closed indices are not included in the response.
6060
* @server_default false
@@ -75,6 +75,11 @@ export interface Request extends RequestBase {
7575
types?: string[]
7676
}
7777
body: {
78+
/**
79+
* List of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported.
80+
* @since 8.5.0
81+
*/
82+
fields?: Fields
7883
/**
7984
* Allows to filter indices if the provided query rewrites to match_none on every shard.
8085
*/

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,
@@ -87,4 +88,5 @@ export enum HighlighterType {
8788
export class HighlightField extends HighlightBase {
8889
fragment_offset?: integer
8990
matched_fields?: Fields
91+
analyzer?: Analyzer
9092
}

specification/_global/search/_types/hits.ts

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

4040
export class Hit<TDocument> {
4141
_index: IndexName
42+
/**
43+
* @es_quirk '_id' is not available when using 'stored_fields: _none_'
44+
* on a search request. Otherwise the field is always present on hits.
45+
*/
4246
_id: Id
4347
_score?: double | null
4448
_explanation?: Explanation

specification/_global/search/_types/profile.ts

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

148148
export class FetchProfileBreakdown {
149+
load_source?: integer
150+
load_source_count?: integer
149151
load_stored_fields?: integer
150152
load_stored_fields_count?: integer
151153
next_reader?: integer

specification/_types/Node.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,16 @@ export class NodeAttributes {
4444
/** The ephemeral ID of the node. */
4545
ephemeral_id: Id
4646
/** The unique identifier of the node. */
47-
id?: Id
47+
id?: NodeId
4848
/** The unique identifier of the node. */
4949
name: NodeName
5050
/** The host and port where transport HTTP connections are accepted. */
5151
transport_address: TransportAddress
5252
roles?: NodeRoles
53+
/**
54+
* @since 8.3.0
55+
*/
56+
external_id: string
5357
}
5458

5559
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
@@ -562,9 +562,15 @@ export class AdjacencyMatrixBucket extends MultiBucketBase {
562562
key: string
563563
}
564564

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

569575
export class SignificantTermsBucketBase extends MultiBucketBase {
570576
score: double
@@ -578,10 +584,7 @@ export class SignificantLongTermsBucket extends SignificantTermsBucketBase {
578584

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

586589
export class SignificantStringTermsBucket extends SignificantTermsBucketBase {
587590
key: string
@@ -593,7 +596,7 @@ export class SignificantStringTermsBucket extends SignificantTermsBucketBase {
593596
*/
594597
// ES: UnmappedSignificantTerms
595598
// See note in UnmappedTermsAggregate
596-
export class UnmappedSignificantTermsAggregate extends MultiBucketAggregateBase<Void> {}
599+
export class UnmappedSignificantTermsAggregate extends SignificantTermsAggregateBase<Void> {}
597600

598601
/** @variant name=composite */
599602
// 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)