Skip to content
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
18 changes: 0 additions & 18 deletions docs/doc_examples/18de6782bd18f4a9baec2feec8c02a8b.asciidoc

This file was deleted.

13 changes: 0 additions & 13 deletions docs/doc_examples/2f67db5e4d6c958258c3d70fb2d0b1c8.asciidoc

This file was deleted.

42 changes: 42 additions & 0 deletions docs/doc_examples/49a19615ebe2c013b8321152163478ab.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.index({
index: "my-index-000001",
id: 1,
refresh: "true",
document: {
text: "quick brown fox",
},
});
console.log(response);

const response1 = await client.index({
index: "my-index-000001",
id: 2,
refresh: "true",
document: {
text: "quick fox",
},
});
console.log(response1);

const response2 = await client.search({
index: "my-index-000001",
query: {
script_score: {
query: {
match: {
text: "quick brown fox",
},
},
script: {
source: "_termStats.termFreq().getAverage()",
},
},
},
});
console.log(response2);
----
15 changes: 0 additions & 15 deletions docs/doc_examples/67154a4837cf996a9a9c3e61d6e9d1b3.asciidoc

This file was deleted.

23 changes: 0 additions & 23 deletions docs/doc_examples/7a32f44a1511ecb0d3f0b0ff2aca5c44.asciidoc

This file was deleted.

2 changes: 1 addition & 1 deletion docs/reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ A post filter has no impact on the aggregation results.
NOTE: This is a debugging tool and adds significant overhead to search execution.
** *`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.
** *`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.
** *`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.
** *`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.
** *`script_fields` (Optional, Record<string, { script, ignore_failure }>)*: Retrieve a script evaluation (based on different fields) for each hit.
** *`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.
** *`size` (Optional, number)*: The number of hits to return.
Expand Down
11 changes: 10 additions & 1 deletion src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2628,12 +2628,14 @@ export interface Retries {

export interface RetrieverBase {
filter?: QueryDslQueryContainer | QueryDslQueryContainer[]
min_score?: float
}

export interface RetrieverContainer {
standard?: StandardRetriever
knn?: KnnRetriever
rrf?: RRFRetriever
text_similarity_reranker?: TextSimilarityReranker
}

export type Routing = string
Expand Down Expand Up @@ -2798,7 +2800,6 @@ export interface StandardRetriever extends RetrieverBase {
search_after?: SortResults
terminate_after?: integer
sort?: Sort
min_score?: float
collapse?: SearchFieldCollapse
}

Expand Down Expand Up @@ -2835,6 +2836,14 @@ export interface TextEmbedding {
model_text: string
}

export interface TextSimilarityReranker extends RetrieverBase {
retriever: RetrieverContainer
rank_window_size?: integer
inference_id?: string
inference_text?: string
field?: string
}

export type ThreadType = 'cpu' | 'wait' | 'block' | 'gpu' | 'mem'

export type TimeOfDay = string
Expand Down
11 changes: 10 additions & 1 deletion src/api/typesWithBodyKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2704,12 +2704,14 @@ export interface Retries {

export interface RetrieverBase {
filter?: QueryDslQueryContainer | QueryDslQueryContainer[]
min_score?: float
}

export interface RetrieverContainer {
standard?: StandardRetriever
knn?: KnnRetriever
rrf?: RRFRetriever
text_similarity_reranker?: TextSimilarityReranker
}

export type Routing = string
Expand Down Expand Up @@ -2874,7 +2876,6 @@ export interface StandardRetriever extends RetrieverBase {
search_after?: SortResults
terminate_after?: integer
sort?: Sort
min_score?: float
collapse?: SearchFieldCollapse
}

Expand Down Expand Up @@ -2911,6 +2912,14 @@ export interface TextEmbedding {
model_text: string
}

export interface TextSimilarityReranker extends RetrieverBase {
retriever: RetrieverContainer
rank_window_size?: integer
inference_id?: string
inference_text?: string
field?: string
}

export type ThreadType = 'cpu' | 'wait' | 'block' | 'gpu' | 'mem'

export type TimeOfDay = string
Expand Down
Loading