public class Elasticsearch6Client extends Object implements ElasticsearchClient
Constructor and Description |
---|
Elasticsearch6Client(String addressExternal)
Instantiates a new Elasticsearch 6 client.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the client.
|
void |
createIndexIfDoesNotExist(String indexName,
int shards,
int replicas)
Create index if it does not exist.
|
void |
deleteIndex(String indexName)
Delete the index.
|
List<KeyValue<Integer,String>> |
fetchAll(QueryParams params)
Fetch all results from the index.
|
void |
refreshIndex(String indexName)
Refresh the index.
|
public Elasticsearch6Client(String addressExternal)
addressExternal
- The address to access Elasticsearch from the host machine (outside of
the containerized environment).public void deleteIndex(String indexName)
ElasticsearchClient
deleteIndex
in interface ElasticsearchClient
indexName
- The index name.public void refreshIndex(String indexName)
ElasticsearchClient
refreshIndex
in interface ElasticsearchClient
indexName
- The index name.public void createIndexIfDoesNotExist(String indexName, int shards, int replicas)
ElasticsearchClient
createIndexIfDoesNotExist
in interface ElasticsearchClient
indexName
- The index name.shards
- The number of shards.replicas
- The number of replicas.public void close() throws Exception
ElasticsearchClient
close
in interface ElasticsearchClient
Exception
public List<KeyValue<Integer,String>> fetchAll(QueryParams params)
ElasticsearchClient
fetchAll
in interface ElasticsearchClient
params
- The parameters of the query.Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.