Skip to content

Commit 0e98719

Browse files
Auto-generated code for 8.x (#2426)
1 parent 7da9976 commit 0e98719

8 files changed

+63
-72
lines changed

docs/doc_examples/18de6782bd18f4a9baec2feec8c02a8b.asciidoc

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/doc_examples/2f67db5e4d6c958258c3d70fb2d0b1c8.asciidoc

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.index({
7+
index: "my-index-000001",
8+
id: 1,
9+
refresh: "true",
10+
document: {
11+
text: "quick brown fox",
12+
},
13+
});
14+
console.log(response);
15+
16+
const response1 = await client.index({
17+
index: "my-index-000001",
18+
id: 2,
19+
refresh: "true",
20+
document: {
21+
text: "quick fox",
22+
},
23+
});
24+
console.log(response1);
25+
26+
const response2 = await client.search({
27+
index: "my-index-000001",
28+
query: {
29+
script_score: {
30+
query: {
31+
match: {
32+
text: "quick brown fox",
33+
},
34+
},
35+
script: {
36+
source: "_termStats.termFreq().getAverage()",
37+
},
38+
},
39+
},
40+
});
41+
console.log(response2);
42+
----

docs/doc_examples/67154a4837cf996a9a9c3e61d6e9d1b3.asciidoc

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/doc_examples/7a32f44a1511ecb0d3f0b0ff2aca5c44.asciidoc

Lines changed: 0 additions & 23 deletions
This file was deleted.

docs/reference.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ A post filter has no impact on the aggregation results.
10141014
NOTE: This is a debugging tool and adds significant overhead to search execution.
10151015
** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Defines the search definition using the Query DSL.
10161016
** *`rescore` (Optional, { window_size, query, learning_to_rank } | { window_size, query, learning_to_rank }[])*: Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the `query` and `post_filter` phases.
1017-
** *`retriever` (Optional, { standard, knn, rrf })*: A retriever is a specification to describe top documents returned from a search. A retriever replaces other elements of the search API that also return top documents such as query and knn.
1017+
** *`retriever` (Optional, { standard, knn, rrf, text_similarity_reranker })*: A retriever is a specification to describe top documents returned from a search. A retriever replaces other elements of the search API that also return top documents such as query and knn.
10181018
** *`script_fields` (Optional, Record<string, { script, ignore_failure }>)*: Retrieve a script evaluation (based on different fields) for each hit.
10191019
** *`search_after` (Optional, number | number | string | boolean | null | User-defined value[])*: Used to retrieve the next page of hits using a set of sort values from the previous page.
10201020
** *`size` (Optional, number)*: The number of hits to return.

src/api/types.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2628,12 +2628,14 @@ export interface Retries {
26282628

26292629
export interface RetrieverBase {
26302630
filter?: QueryDslQueryContainer | QueryDslQueryContainer[]
2631+
min_score?: float
26312632
}
26322633

26332634
export interface RetrieverContainer {
26342635
standard?: StandardRetriever
26352636
knn?: KnnRetriever
26362637
rrf?: RRFRetriever
2638+
text_similarity_reranker?: TextSimilarityReranker
26372639
}
26382640

26392641
export type Routing = string
@@ -2798,7 +2800,6 @@ export interface StandardRetriever extends RetrieverBase {
27982800
search_after?: SortResults
27992801
terminate_after?: integer
28002802
sort?: Sort
2801-
min_score?: float
28022803
collapse?: SearchFieldCollapse
28032804
}
28042805

@@ -2835,6 +2836,14 @@ export interface TextEmbedding {
28352836
model_text: string
28362837
}
28372838

2839+
export interface TextSimilarityReranker extends RetrieverBase {
2840+
retriever: RetrieverContainer
2841+
rank_window_size?: integer
2842+
inference_id?: string
2843+
inference_text?: string
2844+
field?: string
2845+
}
2846+
28382847
export type ThreadType = 'cpu' | 'wait' | 'block' | 'gpu' | 'mem'
28392848

28402849
export type TimeOfDay = string

src/api/typesWithBodyKey.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2704,12 +2704,14 @@ export interface Retries {
27042704

27052705
export interface RetrieverBase {
27062706
filter?: QueryDslQueryContainer | QueryDslQueryContainer[]
2707+
min_score?: float
27072708
}
27082709

27092710
export interface RetrieverContainer {
27102711
standard?: StandardRetriever
27112712
knn?: KnnRetriever
27122713
rrf?: RRFRetriever
2714+
text_similarity_reranker?: TextSimilarityReranker
27132715
}
27142716

27152717
export type Routing = string
@@ -2874,7 +2876,6 @@ export interface StandardRetriever extends RetrieverBase {
28742876
search_after?: SortResults
28752877
terminate_after?: integer
28762878
sort?: Sort
2877-
min_score?: float
28782879
collapse?: SearchFieldCollapse
28792880
}
28802881

@@ -2911,6 +2912,14 @@ export interface TextEmbedding {
29112912
model_text: string
29122913
}
29132914

2915+
export interface TextSimilarityReranker extends RetrieverBase {
2916+
retriever: RetrieverContainer
2917+
rank_window_size?: integer
2918+
inference_id?: string
2919+
inference_text?: string
2920+
field?: string
2921+
}
2922+
29142923
export type ThreadType = 'cpu' | 'wait' | 'block' | 'gpu' | 'mem'
29152924

29162925
export type TimeOfDay = string

0 commit comments

Comments
 (0)