Skip to content

Commit c54052b

Browse files
authored
Backport 5683 to 9.1 (#5821)
* Configure UpdateForV10 tag with eslint-plugin-jsdoc (#5683) * Configure UpdateForV10 tag with eslint-plugin-jsdoc We sometimes want to make breaking changes but have to wait until the next major version. To not forget about those, this commit introduces an UpdateForV10 JSDoc tag that can be used in any commment. There are a few benefits of using JSDoc instead of a simple TODO comment: * With the allowlist of tags in our eslint config, we can't make typos * We enforce a proper description to explain why the breaking change needs to be made Note that this tag has the same name as the Elasticsearch UpdateForV10 annotation, as we'll migrate to Elasticsearch in the future. * Run make spec-format-fix * fix merge * fix merge * fix merge * fix merge
1 parent f7bdf1d commit c54052b

File tree

43 files changed

+584
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+584
-223
lines changed

docs/modeling-guide.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,3 +807,12 @@ class Foo {
807807
#### `@stability` and `@visibility`
808808
809809
These annotations have been removed, use `@availability` instead.
810+
811+
#### `@UpdateForV10`
812+
813+
We sometimes want to make breaking changes but have to wait until the next major version.
814+
To not forget about those change, you can use the UpdateForV10 JSDoc tag in any commment.
815+
There are a few benefits of using JSDoc instead of a simple TODO comment:
816+
817+
* With the allowlist of tags in our eslint config, we can't make typos
818+
* We enforce a proper description to explain why the breaking change needs to be made

specification/_global/index/IndexRequest.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,14 @@ import { Duration } from '@_types/Time'
146146
* "id": "elkbee"
147147
* }
148148
* }
149+
* ```
149150
*
150151
* In this example, the operation will succeed since the supplied version of 2 is higher than the current document version of 1.
151152
* If the document was already updated and its version was set to 2 or higher, the indexing command will fail and result in a conflict (409 HTTP status code).
152153
*
153154
* A nice side effect is that there is no need to maintain strict ordering of async indexing operations run as a result of changes to a source database, as long as version numbers from the source database are used.
154155
* Even the simple case of updating the Elasticsearch index using data from a database is simplified if external versioning is used, as only the latest version will be used if the index operations arrive out of order.
156+
*
155157
* @rest_spec_name index
156158
* @availability stack stability=stable
157159
* @availability serverless stability=stable visibility=public

specification/_global/search_template/SearchTemplateRequest.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ export interface Request extends RequestBase {
109109
*/
110110
scroll?: Duration
111111
/**
112-
* The type of the search operation. */
112+
* The type of the search operation.
113+
*/
113114
search_type?: SearchType
114115
/**
115116
* If `true`, `hits.total` is rendered as an integer in the response.

specification/_global/update_by_query/UpdateByQueryResponse.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export class Response {
3232
* If this is non-empty then the request ended because of those failures.
3333
* Update by query is implemented using batches.
3434
* Any failure causes the entire process to end, but all failures in the current batch are collected into the array.
35-
* You can use the `conflicts` option to prevent reindex from ending when version conflicts occur. */
35+
* You can use the `conflicts` option to prevent reindex from ending when version conflicts occur.
36+
*/
3637
failures?: BulkIndexByScrollFailure[]
3738
/** The number of documents that were ignored because the script used for the update by query returned a noop value for `ctx.op`. */
3839
noops?: long
@@ -43,7 +44,8 @@ export class Response {
4344
/**
4445
* The number of retries attempted by update by query.
4546
* `bulk` is the number of bulk actions retried.
46-
* `search` is the number of search actions retried. */
47+
* `search` is the number of search actions retried.
48+
*/
4749
retries?: Retries
4850
task?: TaskId
4951
/** If true, some requests timed out during the update by query. */
@@ -60,8 +62,10 @@ export class Response {
6062
/** The number of milliseconds the request slept to conform to `requests_per_second`. */
6163
throttled_millis?: DurationValue<UnitMillis>
6264
throttled_until?: Duration
63-
/** This field should always be equal to zero in an _update_by_query response.
64-
* It only has meaning when using the task API, where it indicates the next time (in milliseconds since epoch) a throttled request will be run again in order to conform to `requests_per_second`. */
65+
/**
66+
* This field should always be equal to zero in an _update_by_query response.
67+
* It only has meaning when using the task API, where it indicates the next time (in milliseconds since epoch) a throttled request will be run again in order to conform to `requests_per_second`.
68+
*/
6569
throttled_until_millis?: DurationValue<UnitMillis>
6670
}
6771
}

specification/_spec_utils/UserDefinedValue.ts

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

20-
/** Rather then documenting `object` this specifies places in the response that depend on the mapping and or request
21-
* e.g the result of a script can be anything from value types to objects */
20+
/**
21+
* Rather then documenting `object` this specifies places in the response that depend on the mapping and or request
22+
* e.g the result of a script can be anything from value types to objects
23+
*/
2224
export class UserDefinedValue {}

specification/_types/Knn.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export interface KnnSearch {
5454
* @doc_id knn-inner-hits
5555
*/
5656
inner_hits?: InnerHits
57-
/** Apply oversampling and rescoring to quantized vectors
57+
/**
58+
* Apply oversampling and rescoring to quantized vectors
5859
* @availability stack since=8.18.0
5960
* @availability serverless
6061
*/
@@ -79,7 +80,8 @@ export interface KnnQuery extends QueryBase {
7980
filter?: QueryContainer | QueryContainer[]
8081
/** The minimum similarity for a vector to be considered a match */
8182
similarity?: float
82-
/** Apply oversampling and rescoring to quantized vectors
83+
/**
84+
* Apply oversampling and rescoring to quantized vectors
8385
* @availability stack since=8.18.0
8486
* @availability serverless
8587
*/

specification/_types/Retriever.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ export class KnnRetriever extends RetrieverBase {
125125
num_candidates: integer
126126
/** The minimum similarity required for a document to be considered a match. */
127127
similarity?: float
128-
/** Apply oversampling and rescoring to quantized vectors
128+
/**
129+
* Apply oversampling and rescoring to quantized vectors
129130
* @availability stack since=8.18.0
130131
* @availability serverless
131132
*/

specification/_types/TokenPruningConfig.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,18 @@
2020
import { float, integer } from '@_types/Numeric'
2121

2222
export class TokenPruningConfig {
23-
/** Tokens whose frequency is more than this threshold times the average frequency of all tokens in the specified field are considered outliers and pruned.
23+
/**
24+
* Tokens whose frequency is more than this threshold times the average frequency of all tokens in the specified field are considered outliers and pruned.
2425
* @server_default 5
2526
*/
2627
tokens_freq_ratio_threshold?: integer
27-
/** Tokens whose weight is less than this threshold are considered nonsignificant and pruned.
28+
/**
29+
* Tokens whose weight is less than this threshold are considered nonsignificant and pruned.
2830
* @server_default 0.4
2931
*/
3032
tokens_weight_threshold?: float
31-
/** Whether to only score pruned tokens, vs only scoring kept tokens.
33+
/**
34+
* Whether to only score pruned tokens, vs only scoring kept tokens.
3235
* @server_default false
3336
*/
3437
only_score_pruned_tokens?: boolean

specification/_types/aggregations/Aggregate.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,8 @@ export class HistogramBucket extends MultiBucketBase {
451451
key: double
452452
}
453453

454-
/** @variant name=date_histogram
454+
/**
455+
* @variant name=date_histogram
455456
* @ext_doc_id search-aggregations-bucket-datehistogram-aggregation
456457
*/
457458
export class DateHistogramAggregate extends MultiBucketAggregateBase<DateHistogramBucket> {}

specification/_types/aggregations/AggregationContainer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,6 @@ export class AggregationContainer {
457457
* Sampling provides significant speed improvement at the cost of accuracy.
458458
* @ext_doc_id search-aggregations-random-sampler-aggregation
459459
* @availability stack since=8.1.0 stability=experimental
460-
461460
*/
462461
random_sampler?: RandomSamplerAggregation
463462
/**

0 commit comments

Comments
 (0)