Skip to content

[Backport 8.5] Start of fixes for core/search #1956

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
305 changes: 180 additions & 125 deletions output/schema/schema.json

Large diffs are not rendered by default.

27 changes: 17 additions & 10 deletions output/typescript/types.ts

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

7 changes: 6 additions & 1 deletion specification/_global/field_caps/FieldCapabilitiesRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface Request extends RequestBase {
/**
* Comma-separated list of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported.
*/
fields: Fields
fields?: Fields
/**
* If `true`, missing or closed indices are not included in the response.
* @server_default false
Expand All @@ -75,6 +75,11 @@ export interface Request extends RequestBase {
types?: string[]
}
body: {
/**
* List of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported.
* @since 8.5.0
*/
fields?: Fields
/**
* Allows to filter indices if the provided query rewrites to match_none on every shard.
*/
Expand Down
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 @@ -87,4 +88,5 @@ export enum HighlighterType {
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 @@ -39,6 +39,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 | null
_explanation?: Explanation
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 @@ -146,6 +146,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 @@ -44,12 +44,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 @@ -562,9 +562,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 @@ -578,10 +584,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 @@ -593,7 +596,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