Skip to content

Commit

Permalink
Added search_pipeline to search (#716)
Browse files Browse the repository at this point in the history
Signed-off-by: Theo Truong <[email protected]>
  • Loading branch information
nhtruong authored Apr 4, 2024
1 parent a86a6a9 commit 49f9aa8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Bumps `@types/node` from 20.11.25 to 20.12.2
- Bumps `@babel/eslint-parser` from 7.23.10 to 7.24.1
### Changed
- Added `search_pipeline` ([716](https://github.com/opensearch-project/opensearch-js/pull/716))
### Deprecated
### Removed
### Fixed
Expand Down Expand Up @@ -247,4 +248,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

### Fixed

- Fix mutability of connection headers ([#291](https://github.com/opensearch-project/opensearch-js/issues/291))
- Fix mutability of connection headers ([#291](https://github.com/opensearch-project/opensearch-js/issues/291))
3 changes: 3 additions & 0 deletions api/api/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const acceptedQuerystring = [
'q',
'routing',
'scroll',
'search_pipeline',
'search_type',
'size',
'sort',
Expand Down Expand Up @@ -97,6 +98,7 @@ const snakeCase = {
ignoreThrottled: 'ignore_throttled',
allowNoIndices: 'allow_no_indices',
expandWildcards: 'expand_wildcards',
searchPipeline: 'search_pipeline',
searchType: 'search_type',
_sourceExcludes: '_source_excludes',
_sourceExclude: '_source_exclude',
Expand Down Expand Up @@ -148,6 +150,7 @@ const snakeCase = {
* @param {string} [params.q] - Query in the Lucene query string syntax
* @param {string} [params.routing] - A comma-separated list of specific routing values
* @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search
* @param {string} [params.search_pipeline] - Customizable sequence of processing stages applied to search queries.
* @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
* @param {number} [params.size] - Number of hits to return (default: 10)
* @param {string} [params.sort] - A comma-separated list of <field>:<direction> pairs
Expand Down
1 change: 1 addition & 0 deletions api/requestParams.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,7 @@ export interface Search<T = RequestBody> extends Generic {
q?: string;
routing?: string | string[];
scroll?: string;
search_pipeline?: string;
search_type?: 'query_then_fetch' | 'dfs_query_then_fetch';
size?: number;
sort?: string | string[];
Expand Down
2 changes: 2 additions & 0 deletions api/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ export interface SearchRequest extends RequestBase {
request_cache?: boolean;
routing?: Routing;
scroll?: Time;
search_pipeline?: string;
search_type?: SearchType;
stats?: string[];
stored_fields?: Fields;
Expand Down Expand Up @@ -973,6 +974,7 @@ export interface SearchRequest extends RequestBase {
query?: QueryDslQueryContainer;
rescore?: SearchRescore | SearchRescore[];
script_fields?: Record<string, ScriptField>;
search_pipeline?: Record<string, any>;
search_after?: (integer | string)[];
size?: integer;
slice?: SlicedScroll;
Expand Down

0 comments on commit 49f9aa8

Please sign in to comment.