Skip to content

Commit

Permalink
Adds documentation for providing search pipeline id in the search/mse…
Browse files Browse the repository at this point in the history
…arch request (#8372)

* Adds documentation for providing search pipeline id in the request

Signed-off-by: Owais <[email protected]>

* Doc review

Signed-off-by: Fanit Kolchina <[email protected]>

---------

Signed-off-by: Owais <[email protected]>
Signed-off-by: Fanit Kolchina <[email protected]>
Co-authored-by: Fanit Kolchina <[email protected]>
  • Loading branch information
owaiskazi19 and kolchfa-aws committed Sep 26, 2024
1 parent c0127fb commit a6a3396
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions _search-plugins/search-pipelines/using-search-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,45 @@ You can use a search pipeline in the following ways:

## Specifying an existing search pipeline for a request

After you [create a search pipeline]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/creating-search-pipeline/), you can use the pipeline with a query by specifying the pipeline name in the `search_pipeline` query parameter:
After you [create a search pipeline]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/creating-search-pipeline/), you can use the pipeline with a query in the following ways. For a complete example of using a search pipeline with a `filter_query` processor, see [`filter_query` processor example]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/filter-query-processor#example).

### Specifying the pipeline in a query parameter

You can specify the pipeline name in the `search_pipeline` query parameter as follows:

```json
GET /my_index/_search?search_pipeline=my_pipeline
```
{% include copy-curl.html %}

For a complete example of using a search pipeline with a `filter_query` processor, see [`filter_query` processor example]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/filter-query-processor#example).
### Specifying the pipeline in the request body

You can provide a search pipeline ID in the search request body as follows:

```json
GET /my-index/_search
{
"query": {
"match_all": {}
},
"from": 0,
"size": 10,
"search_pipeline": "my_pipeline"
}
```
{% include copy-curl.html %}

For multi-search, you can provide a search pipeline ID in the search request body as follows:

```json
GET /_msearch
{ "index": "test"}
{ "query": { "match_all": {} }, "from": 0, "size": 10, "search_pipeline": "my_pipeline"}
{ "index": "test-1", "search_type": "dfs_query_then_fetch"}
{ "query": { "match_all": {} }, "search_pipeline": "my_pipeline1" }

```
{% include copy-curl.html %}

## Using a temporary search pipeline for a request

Expand Down

0 comments on commit a6a3396

Please sign in to comment.