public class ElasticSearchNativeClient extends Object implements ElasticSearchClient<ElasticSearchNativeClient>
| Modifier and Type | Field and Description |
|---|---|
protected String |
clusterName |
protected static String |
EL_CLIENT_TIMEOUT |
protected static String |
EL_CLUTER_NAME |
protected String[] |
index |
protected String |
serverURL |
protected long |
timeout |
protected String[] |
type |
HEADER_RESPONSE_CODE, RESPONSE_CODE_NOT_FOUND, RESPONSE_CODE_OK| Constructor and Description |
|---|
ElasticSearchNativeClient(ElasticSearchClientFactory clientFactory,
ElasticSearchValueTypeMapper valueTypeMapper,
IntervalBuilderDynamicDate intervalBuilderDynamicDate,
ElasticSearchUtils utils) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
ElasticSearchNativeClient |
clusterName(String clusterName)
Builds the client for a given cluster.
|
CountResponse |
count(String[] index,
String... type)
Count documents for a given index/es and type/es
|
MappingsResponse |
getMappings(String... index)
Obtain the mappings for a given index/es.
|
ElasticSearchNativeClient |
index(String... indexes)
Builds the client for a given index/es.
|
SearchResponse |
search(ElasticSearchDataSetDef definition,
DataSetMetadata metadata,
SearchRequest request)
Obtain documents for a given index/es and type/es
If the index/es value set in the
request is null returns all documents of all indexes. |
ElasticSearchNativeClient |
serverURL(String serverURL)
Builds the client for a given serer URL.
|
ElasticSearchNativeClient |
setTimeout(int timeout)
Sets the timeout value for the HTTP rest client requests.
|
ElasticSearchNativeClient |
type(String... types)
Builds the client for a given types/es.
|
protected static final String EL_CLUTER_NAME
protected static final String EL_CLIENT_TIMEOUT
protected String serverURL
protected String clusterName
protected String[] index
protected String[] type
protected long timeout
public ElasticSearchNativeClient(ElasticSearchClientFactory clientFactory, ElasticSearchValueTypeMapper valueTypeMapper, IntervalBuilderDynamicDate intervalBuilderDynamicDate, ElasticSearchUtils utils)
public ElasticSearchNativeClient serverURL(String serverURL)
ElasticSearchClientserverURL in interface ElasticSearchClient<ElasticSearchNativeClient>serverURL - The ElasticSearch server URL.public ElasticSearchNativeClient index(String... indexes)
ElasticSearchClientindex in interface ElasticSearchClient<ElasticSearchNativeClient>indexes - The ElasticSearch index/es.public ElasticSearchNativeClient type(String... types)
ElasticSearchClienttype in interface ElasticSearchClient<ElasticSearchNativeClient>types - The ElasticSearch types/es.public ElasticSearchNativeClient clusterName(String clusterName)
ElasticSearchClientclusterName in interface ElasticSearchClient<ElasticSearchNativeClient>clusterName - The ElasticSearch cluster name.public ElasticSearchNativeClient setTimeout(int timeout)
ElasticSearchClientsetTimeout in interface ElasticSearchClient<ElasticSearchNativeClient>timeout - The timeout value in miliseconds.public MappingsResponse getMappings(String... index) throws ElasticSearchClientGenericException
ElasticSearchClientgetMappings in interface ElasticSearchClient<ElasticSearchNativeClient>index - The index/es to obtain the mappings.ElasticSearchClientGenericExceptionpublic CountResponse count(String[] index, String... type) throws ElasticSearchClientGenericException
ElasticSearchClientcount in interface ElasticSearchClient<ElasticSearchNativeClient>index - The index/es for the document type to count. If value is null returns the count number of all documents if all indexes.type - The type/s of the documents to count. If value is null returns the count number of all documents in all indexes or in the index specified by index.ElasticSearchClientGenericExceptionpublic SearchResponse search(ElasticSearchDataSetDef definition, DataSetMetadata metadata, SearchRequest request) throws ElasticSearchClientGenericException
ElasticSearchClientObtain documents for a given index/es and type/es
If the index/es value set in the request is null returns all documents of all indexes.
If the type/s value set in the request is null returns all documents in all indexes or in the index specified by index.
search in interface ElasticSearchClient<ElasticSearchNativeClient>definition - The dataset definition.metadata - The metadata.request - The search request.ElasticSearchClientGenericExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2017–2020 JBoss by Red Hat. All rights reserved.