Skip to content

Commit a6a3396

Browse files
Adds documentation for providing search pipeline id in the search/msearch 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]>
1 parent c0127fb commit a6a3396

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

_search-plugins/search-pipelines/using-search-pipeline.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,45 @@ You can use a search pipeline in the following ways:
1717

1818
## Specifying an existing search pipeline for a request
1919

20-
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:
20+
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).
21+
22+
### Specifying the pipeline in a query parameter
23+
24+
You can specify the pipeline name in the `search_pipeline` query parameter as follows:
2125

2226
```json
2327
GET /my_index/_search?search_pipeline=my_pipeline
2428
```
2529
{% include copy-curl.html %}
2630

27-
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).
31+
### Specifying the pipeline in the request body
32+
33+
You can provide a search pipeline ID in the search request body as follows:
34+
35+
```json
36+
GET /my-index/_search
37+
{
38+
"query": {
39+
"match_all": {}
40+
},
41+
"from": 0,
42+
"size": 10,
43+
"search_pipeline": "my_pipeline"
44+
}
45+
```
46+
{% include copy-curl.html %}
47+
48+
For multi-search, you can provide a search pipeline ID in the search request body as follows:
49+
50+
```json
51+
GET /_msearch
52+
{ "index": "test"}
53+
{ "query": { "match_all": {} }, "from": 0, "size": 10, "search_pipeline": "my_pipeline"}
54+
{ "index": "test-1", "search_type": "dfs_query_then_fetch"}
55+
{ "query": { "match_all": {} }, "search_pipeline": "my_pipeline1" }
56+
57+
```
58+
{% include copy-curl.html %}
2859

2960
## Using a temporary search pipeline for a request
3061

0 commit comments

Comments
 (0)