Skip to content

Adds documentation for providing search pipeline id in the search/msearch request #8372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Changes from 1 commit
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
26 changes: 25 additions & 1 deletion _search-plugins/search-pipelines/using-search-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,32 @@
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).

## Using a temporary search pipeline for a request
1. You can provide a search pipeline id in the search request:

As an alternative to creating a search pipeline, you can define a temporary search pipeline to be used for only the current query:
```json
GET /my-index/_search
{
"query": {
"match_all": {}
},
"from": 0,
"size": 10,
"search_pipeline": "my_pipeline"
}
```

or for msearch

Check failure on line 44 in _search-plugins/search-pipelines/using-search-pipeline.md

View workflow job for this annotation

GitHub Actions / style-job

[vale] reported by reviewdog 🐶 [OpenSearch.Spelling] Error: msearch. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks. Raw Output: {"message": "[OpenSearch.Spelling] Error: msearch. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks.", "location": {"path": "_search-plugins/search-pipelines/using-search-pipeline.md", "range": {"start": {"line": 44, "column": 8}}}, "severity": "ERROR"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know that this is a true "pattern", (and if it is we should have Vale enforce it), but in other places in the docs I see it referred to as "multi-search". For example I see "All multi-search URL parameters are optional.".

Suggested change
or for msearch
or for multi-search:

```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 %}

2. As an alternative to creating a search pipeline, you can define a temporary search pipeline to be used for only the current query:

```json
POST /my-index/_search
Expand Down
Loading