Doc updates (#791)

Updates for better displaying the documentation in the website.
This commit is contained in:
Tomas Della Vedova
2019-03-27 07:44:19 +01:00
committed by delvedor
parent 3a1bb9377a
commit 4537308c38
23 changed files with 515 additions and 230 deletions

View File

@ -1,3 +1,4 @@
[[as_stream_examples]]
== asStream
Instead of getting the parsed body back, you will get the raw Node.js stream of data.

View File

@ -1,4 +1,5 @@
= Bulk
[[bulk_examples]]
== Bulk
The `bulk` API makes it possible to perform many index/delete operations in a single API call. +
This can greatly increase the indexing speed.

View File

@ -1,4 +1,5 @@
= Exists
[[exists_examples]]
== Exists
Check that the document `/game-of-thrones/1` exists.

View File

@ -1,4 +1,5 @@
= Get
[[get_examples]]
== Get
The get API allows to get a typed JSON document from the index based on its id. +
The following example gets a JSON document from an index called `game-of-thrones`, under a type called `_doc`, with id valued `'1'`.

View File

@ -1,3 +1,4 @@
[[ignore_examples]]
== Ignore
HTTP status codes which should not be considered errors for this request.

View File

@ -0,0 +1,28 @@
[[examples]]
= Examples
Following you can find some examples on how to use the client.
* Use of the <<as_stream_examples,asStream>> parameter;
* Executing a <<bulk_examples,bulk>> request;
* Executing a <<exists_examples,exists>> request;
* Executing a <<get_examples,get>> request;
* Use of the <<ignore_examples,ignore>> parameter;
* Executing a <<msearch_examples,msearch>> request;
* How do I <<scroll_examples,scroll>>?
* Executing a <<search_examples,search>> request;
* I need <<suggest_examples,suggestions>>;
* How to use the <<transport_request_examples,transport.request>> method;
* How to use <<typescript_examples,TypeScript>>;
include::asStream.asciidoc[]
include::bulk.asciidoc[]
include::exists.asciidoc[]
include::get.asciidoc[]
include::ignore.asciidoc[]
include::msearch.asciidoc[]
include::scroll.asciidoc[]
include::search.asciidoc[]
include::suggest.asciidoc[]
include::transport.request.asciidoc[]
include::typescript.asciidoc[]

View File

@ -1,4 +1,5 @@
= MSearch
[[msearch_examples]]
== MSearch
The multi search API allows to execute several search requests within the same API.

View File

@ -1,4 +1,5 @@
= Scroll
[[scroll_examples]]
== Scroll
While a search request returns a single “page” of results, the scroll API can be used to retrieve large numbers of results (or even all results) from a single search request, in much the same way as you would use a cursor on a traditional database.

View File

@ -1,4 +1,5 @@
= Search
[[search_examples]]
== Search
The `search` API allows you to execute a search query and get back search hits that match the query. +
The query can either be provided using a simple https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-uri-request.html[query string as a parameter], or using a https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-request-body.html[request body].

View File

@ -1,4 +1,5 @@
= Suggest
[[suggest_examples]]
== Suggest
The suggest feature suggests similar looking terms based on a provided text by using a suggester. _Parts of the suggest feature are still under development._

View File

@ -1,4 +1,5 @@
= transport.request
[[transport_request_examples]]
== transport.request
It can happen that you need to communicate with Elasticsearch by using an API that is not supported by the client, to mitigate this issue you can directly call `client.transport.request`, which is the internal utility that the client uses to communicate with Elasticsearch when you use an API method.

View File

@ -1,4 +1,5 @@
= Typescript
[[typescript_examples]]
== Typescript
The client offers a first-class support for TypeScript, since it ships the type definitions for every exposed API.