Skip to content

Remove references to multiple types in the search documentation. #34625

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 1 commit into from
Oct 19, 2018
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
2 changes: 1 addition & 1 deletion docs/reference/search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[partintro]
--

Most search APIs are <<search-multi-index-type,multi-index&#44; multi-type>>, with the
Most search APIs are <<search-multi-index,multi-index>>, with the
exception of the <<search-explain>> endpoints.

[float]
Expand Down
11 changes: 5 additions & 6 deletions docs/reference/search/count.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
== Count API

The count API allows to easily execute a query and get the number of
matches for that query. It can be executed across one or more indices
and across one or more types. The query can either be provided using a
simple query string as a parameter, or using the
<<query-dsl,Query DSL>> defined within the request
matches for that query. It can be executed across one or more indices.
The query can either be provided using a simple query string as a
parameter, or using the <<query-dsl,Query DSL>> defined within the request
body. Here is an example:

[source,js]
Expand Down Expand Up @@ -50,9 +49,9 @@ The query is optional, and when not provided, it will use `match_all` to
count all the docs.

[float]
=== Multi index, Multi type
=== Multi index

The count API can be applied to <<search-multi-index-type,multiple types in multiple indices>>.
The count API can be applied to <<search-multi-index,multiple indices>>.

[float]
=== Request Parameters
Expand Down
3 changes: 1 addition & 2 deletions docs/reference/search/explain.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ The explain api computes a score explanation for a query and a specific
document. This can give useful feedback whether a document matches or
didn't match a specific query.

The `index` and `type` parameters expect a single index and a single
type respectively.
Note that a single index must be provided to the `index` parameter.

[float]
=== Usage
Expand Down
13 changes: 6 additions & 7 deletions docs/reference/search/multi-search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ body\n
may be preceded by a carriage return `\r`. When sending requests to this endpoint the
`Content-Type` header should be set to `application/x-ndjson`.

The header part includes which index / indices to search on, optional
(mapping) types to search on, the `search_type`, `preference`, and
`routing`. The body includes the typical search body request (including
the `query`, `aggregations`, `from`, `size`, and so on). Here is an example:
The header part includes which index / indices to search on, the `search_type`, `preference`,
and `routing`. The body includes the typical search body request (including the `query`,
`aggregations`, `from`, `size`, and so on). Here is an example:

[source,js]
--------------------------------------------------
Expand Down Expand Up @@ -58,9 +57,9 @@ the original multi search request. If there was a complete failure for that
specific search request, an object with `error` message and corresponding
status code will be returned in place of the actual search response.

The endpoint allows to also search against an index/indices and
type/types in the URI itself, in which case it will be used as the
default unless explicitly defined otherwise in the header. For example:
The endpoint allows to also search against an index/indices in the URI itself,
in which case it will be used as the default unless explicitly defined otherwise
in the header. For example:

[source,js]
--------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/search/request/scroll.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ POST <1> /_search/scroll <2>
// TEST[continued s/DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==/$body._scroll_id/]

<1> `GET` or `POST` can be used.
<2> The URL should not include the `index` or `type` name -- these
are specified in the original `search` request instead.
<2> The URL should not include the `index` name -- this
is specified in the original `search` request instead.
<3> The `scroll` parameter tells Elasticsearch to keep the search context open
for another `1m`.
<4> The `scroll_id` parameter
Expand Down
3 changes: 1 addition & 2 deletions docs/reference/search/search-template.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ body\n
--------------------------------------------------
// NOTCONSOLE

The header part supports the same `index`, `types`, `search_type`,
The header part supports the same `index`, `search_type`,
`preference`, and `routing` options as the usual Multi Search API.

The body includes a search template body request and supports inline,
Expand All @@ -624,7 +624,6 @@ stored and file templates. Here is an example:
$ cat requests
{"index": "test"}
{"source": {"query": {"match": {"user" : "{{username}}" }}}, "params": {"username": "john"}} <1>
{"index": "_all", "types": "accounts"}
{"source": {"query": {"{{query_type}}": {"name": "{{name}}" }}}, "params": {"query_type": "match_phrase_prefix", "name": "Smith"}}
{"index": "_all"}
{"id": "template_1", "params": {"query_string": "search for these words" }} <2>
Expand Down
31 changes: 10 additions & 21 deletions docs/reference/search/search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ that match the query. The query can either be provided using a simple
<<search-uri-request,query string as a parameter>>, or using a
<<search-request-body,request body>>.

["float",id="search-multi-index-type"]
=== Multi-Index, Multi-Type
["float",id="search-multi-index"]
=== Multi-Index

All search APIs can be applied across multiple types within an index, and
across multiple indices with support for the
<<multi-index,multi index syntax>>. For
All search APIs can be applied across multiple indices with support for
the <<multi-index,multi index syntax>>. For
example, we can search on all documents within the twitter index:

[source,js]
Expand All @@ -21,8 +20,8 @@ GET /twitter/_search?q=user:kimchy
// CONSOLE
// TEST[setup:twitter]

We can also search all tweets with a certain tag across several indices
(for example, when each user has his own index):
We can also search all documents with a certain tag across several indices
(for example, when there is one index per user):

[source,js]
--------------------------------------------------
Expand All @@ -31,21 +30,11 @@ GET /kimchy,elasticsearch/_search?q=tag:wow
// CONSOLE
// TEST[s/^/PUT kimchy\nPUT elasticsearch\n/]

Or we can search all tweets across all available indices using `_all`
placeholder:
Or we can search across all available indices using `_all`:

[source,js]
--------------------------------------------------
---------------------------------------------------
GET /_all/_search?q=tag:wow
--------------------------------------------------
// CONSOLE
// TEST[setup:twitter]

Or even search across all indices and all types:

[source,js]
--------------------------------------------------
GET /_search?q=tag:wow
--------------------------------------------------
---------------------------------------------------
// CONSOLE
// TEST[setup:twitter]
// TEST[setup:twitter]