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

This commit is contained in:
Julie Tibshirani 2018-10-19 09:47:34 -07:00 committed by GitHub
parent 1100942455
commit 67652b5355
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 26 additions and 41 deletions

View File

@ -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]

View File

@ -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]
@ -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

View File

@ -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

View File

@ -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]
--------------------------------------------------
@ -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]
--------------------------------------------------

View File

@ -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

View File

@ -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,
@ -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>

View File

@ -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]
@ -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]
--------------------------------------------------
@ -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]