diff --git a/specification/_global/search/_types/highlighting.ts b/specification/_global/search/_types/highlighting.ts index fe50c6e69f..001310b999 100644 --- a/specification/_global/search/_types/highlighting.ts +++ b/specification/_global/search/_types/highlighting.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Dictionary } from '@spec_utils/Dictionary' +import { Dictionary, SingleKeyDictionary } from '@spec_utils/Dictionary' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { Field, Fields } from '@_types/common' import { integer } from '@_types/Numeric' @@ -151,7 +151,9 @@ export class HighlightBase { export class Highlight extends HighlightBase { encoder?: HighlighterEncoder - fields: Dictionary + fields: + | SingleKeyDictionary + | SingleKeyDictionary[] } export enum HighlighterEncoder { diff --git a/specification/_types/Errors.ts b/specification/_types/Errors.ts index 750a305525..6275b4ae27 100644 --- a/specification/_types/Errors.ts +++ b/specification/_types/Errors.ts @@ -38,7 +38,7 @@ export class ErrorCause /** * A human-readable explanation of the error, in English. */ - reason?: string + reason?: string | null /** * The server stack trace. Present only if the `error_trace=true` parameter was sent with the request. */ diff --git a/specification/_types/Retriever.ts b/specification/_types/Retriever.ts index 520640b30a..7c6f16f033 100644 --- a/specification/_types/Retriever.ts +++ b/specification/_types/Retriever.ts @@ -18,6 +18,7 @@ */ import { FieldCollapse } from '@global/search/_types/FieldCollapse' +import { Rescore } from '@global/search/_types/rescoring' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { QueryVector, QueryVectorBuilder, RescoreVector } from '@_types/Knn' import { float, integer } from '@_types/Numeric' @@ -39,6 +40,8 @@ export class RetrieverContainer { text_similarity_reranker?: TextSimilarityReranker /** A retriever that replaces the functionality of a rule query. */ rule?: RuleRetriever + /** A retriever that re-scores only the results produced by its child retriever. */ + rescorer?: RescorerRetriever } export class RetrieverBase { @@ -48,6 +51,12 @@ export class RetrieverBase { min_score?: float } +export class RescorerRetriever extends RetrieverBase { + /** Inner retriever. */ + retriever: RetrieverContainer + rescore: Rescore | Rescore[] +} + export class StandardRetriever extends RetrieverBase { /** Defines a query to retrieve a set of top documents. */ query?: QueryContainer @@ -105,7 +114,7 @@ export class TextSimilarityReranker extends RetrieverBase { export class RuleRetriever extends RetrieverBase { /** The ruleset IDs containing the rules this retriever is evaluating against. */ - ruleset_ids: Id[] + ruleset_ids: Id | Id[] /** The match criteria that will determine if a rule in the provided rulesets should be applied. */ match_criteria: UserDefinedValue /** The retriever whose results rules should be applied to. */ diff --git a/specification/_types/query_dsl/WeightedTokensQuery.ts b/specification/_types/query_dsl/WeightedTokensQuery.ts index 1dabf656a4..3943d399a9 100644 --- a/specification/_types/query_dsl/WeightedTokensQuery.ts +++ b/specification/_types/query_dsl/WeightedTokensQuery.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Dictionary } from '@spec_utils/Dictionary' +import { SingleKeyDictionary } from '@spec_utils/Dictionary' import { float } from '@_types/Numeric' import { QueryBase } from './abstractions' import { TokenPruningConfig } from './TokenPruningConfig' @@ -27,7 +27,7 @@ import { TokenPruningConfig } from './TokenPruningConfig' */ export class WeightedTokensQuery extends QueryBase { /** The tokens representing this query */ - tokens: Dictionary + tokens: SingleKeyDictionary[] /** Token pruning configurations */ pruning_config?: TokenPruningConfig } diff --git a/specification/_types/query_dsl/fulltext.ts b/specification/_types/query_dsl/fulltext.ts index a03ff6ed38..061b6b8566 100644 --- a/specification/_types/query_dsl/fulltext.ts +++ b/specification/_types/query_dsl/fulltext.ts @@ -103,6 +103,8 @@ export class IntervalsContainer { * Matches terms that start with a specified set of characters. */ prefix?: IntervalsPrefix + range?: IntervalsRange + regexp?: IntervalsRegexp /** * Matches terms using a wildcard pattern. */ @@ -232,6 +234,52 @@ export class IntervalsPrefix { use_field?: Field } +export class IntervalsRange { + /** + * Analyzer used to analyze the `prefix`. + * @doc_id analysis + */ + analyzer?: string + /** + * Lower term, either gte or gt must be provided. + */ + gte?: string + /** + * Lower term, either gte or gt must be provided. + */ + gt?: string + /** + * Upper term, either lte or lt must be provided. + */ + lte?: string + /** + * Upper term, either lte or lt must be provided. + */ + lt?: string + /** + * If specified, match intervals from this field rather than the top-level field. + * The `prefix` is normalized using the search analyzer from this field, unless `analyzer` is specified separately. + */ + use_field?: Field +} + +export class IntervalsRegexp { + /** + * Analyzer used to analyze the `prefix`. + * @doc_id analysis + */ + analyzer?: string + /** + * Regex pattern. + */ + pattern: string + /** + * If specified, match intervals from this field rather than the top-level field. + * The `prefix` is normalized using the search analyzer from this field, unless `analyzer` is specified separately. + */ + use_field?: Field +} + /** * @variants container * @ext_doc_id query-dsl-intervals-query @@ -259,6 +307,9 @@ export class IntervalsQuery extends QueryBase { * Matches terms that start with a specified set of characters. */ prefix?: IntervalsPrefix + range?: IntervalsRange + regexp?: IntervalsRegexp + /** * Matches terms using a wildcard pattern. */ diff --git a/specification/_types/query_dsl/geo.ts b/specification/_types/query_dsl/geo.ts index d73e6327e3..01a2fa5f37 100644 --- a/specification/_types/query_dsl/geo.ts +++ b/specification/_types/query_dsl/geo.ts @@ -97,7 +97,7 @@ export class GeoDistanceQuery /** @variants container */ export class GeoGridQuery extends QueryBase { - geogrid?: GeoTile + geotile?: GeoTile geohash?: GeoHash geohex?: GeoHexCell } diff --git a/specification/_types/query_dsl/specialized.ts b/specification/_types/query_dsl/specialized.ts index 081f8a7b75..72291277f1 100644 --- a/specification/_types/query_dsl/specialized.ts +++ b/specification/_types/query_dsl/specialized.ts @@ -400,6 +400,7 @@ export class ShapeFieldQuery { */ export class RuleQuery extends QueryBase { organic: QueryContainer - ruleset_ids: Id[] + ruleset_ids?: Id | Id[] + ruleset_id?: string match_criteria: UserDefinedValue }