-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #605 from elastic/szabosteve/serverless.docs
[DOCS] Adds getting started MDX to the serverless client docs
- Loading branch information
Showing
4 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
--- | ||
id: gettingStartedServerlessJava | ||
slug: /serverless-java/docs/getting-started | ||
title: Getting started with the Serverless Java client | ||
description: This page contains quickstart information about the Serverless Java client. | ||
date: 2023-06-27 | ||
tags: ['serverless','Java client','docs', 'getting started', 'Java'] | ||
--- | ||
|
||
This page guides you through the installation process of the Serverless Java | ||
client, shows you how to instantiate the client, and how to perform basic | ||
Elasticsearch operations with it. | ||
|
||
## Requirements | ||
|
||
[TO DO] | ||
|
||
## Installation | ||
|
||
### Using the command line | ||
|
||
You can install the Elasticsearch Serverless Java client with the following | ||
commands: | ||
|
||
```bash | ||
``` | ||
|
||
|
||
## Instantiate a client | ||
|
||
You can instantiate a client by running the following command: | ||
|
||
```java | ||
|
||
``` | ||
|
||
You can find the Elasticsearch endpoint on the Cloud deployment management page. | ||
|
||
<DocImage url="images/copy-endpoint.gif" alt="Copy the endpoint for Elasticsearch"/> | ||
|
||
You can create a new API Key under **Stack Management** > **Security**: | ||
|
||
<DocImage url="images/setup-api-key.gif" alt="Create and copy API Key"/> | ||
|
||
|
||
## Using the API | ||
|
||
After you instantiated a client with your API key and Elasticsearch endpoint, | ||
you can start ingesting documents into the Elasticsearch Service. You can use | ||
the Bulk API for this. This API enables you to index, update, and delete several | ||
documents in one request. | ||
|
||
|
||
### Creating an index and ingesting documents | ||
|
||
You can call the `bulk` API with a body parameter, an array of hashes that | ||
define the action, and a document. | ||
|
||
The following is an example of indexing some classic books into the `books` | ||
index: | ||
|
||
```java | ||
|
||
``` | ||
|
||
When you use the client to make a request to Elasticsearch, it returns an API | ||
response object. You can check the HTTP return code by calling `status` and the | ||
HTTP headers by calling `headers` on the response object. The response object | ||
also behaves as a Hash, so you can access the body values directly as seen on | ||
the previous example with ``. | ||
|
||
|
||
### Searching | ||
|
||
Now that some data is available, you can search your documents using the | ||
**Search API**: | ||
|
||
```java | ||
``` | ||
|
||
### Updating | ||
|
||
You can update your documents using the Bulk API: | ||
|
||
```java | ||
``` | ||
|
||
### Delete | ||
|
||
You can also delete documents: | ||
|
||
```java | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.