count() throws IOException, OpenSearchException {
- return this.transport.performRequestAsync(new CountRequest.Builder().build(), CountRequest._ENDPOINT,
- this.transportOptions);
- }
-
- // ----- Endpoint: create
-
- /**
- * Creates a new document in the index.
- *
- * Returns a 409 response when a document with a same ID already exists in the
- * index.
- *
- *
- */
-
- public CompletableFuture create(CreateRequest request)
- throws IOException, OpenSearchException {
- @SuppressWarnings("unchecked")
- JsonEndpoint, CreateResponse, ErrorResponse> endpoint =
- (JsonEndpoint, CreateResponse, ErrorResponse>) CreateRequest._ENDPOINT;
-
- return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
- }
-
- /**
- * Creates a new document in the index.
- *
- * Returns a 409 response when a document with a same ID already exists in the
- * index.
- *
- * @param fn
- * a function that initializes a builder to create the
- * {@link CreateRequest}
- *
- */
-
- public final