public class Elastic extends Object
| Constructor and Description |
|---|
Elastic(String strServerUrl)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
String |
create(String strIndex,
String strType,
Object object)
Create a document of given type into a given index
|
String |
create(String strIndex,
String strType,
String strId,
Object object)
Create a document of given type into a given index at the given id
|
String |
createMappings(String strIndex,
String strJsonMappings) |
String |
deleteDocument(String strIndex,
String strType,
String strId)
Delete a document based on its id in the index
|
String |
deleteIndex(String strIndex)
Delete a given index
|
boolean |
isExists(String strIndex)
Check if a given index exists
|
String |
search(String strIndex,
SearchRequest search)
Search a document of given type into a given index
|
String |
suggest(String strIndex,
AbstractSuggestRequest suggest)
suggest a list of document of given type into a given index
|
public Elastic(String strServerUrl)
strServerUrl - The Elastic server URLpublic String create(String strIndex, String strType, Object object) throws ElasticClientException
strIndex - The indexstrType - The document typeobject - The documentElasticClientException - If a problem occurs connecting Elasticpublic String create(String strIndex, String strType, String strId, Object object) throws ElasticClientException
strIndex - The indexstrType - The document typestrId - The document idobject - The documentElasticClientException - If a problem occurs connecting Elasticpublic String deleteIndex(String strIndex) throws ElasticClientException
strIndex - The indexElasticClientException - If a problem occurs connecting Elasticpublic String deleteDocument(String strIndex, String strType, String strId) throws ElasticClientException
strIndex - The indexstrType - The document typestrId - The idElasticClientException - If a problem occurs connecting Elasticpublic boolean isExists(String strIndex) throws ElasticClientException
strIndex - The indexElasticClientException - If a problem occurs connecting Elasticpublic String search(String strIndex, SearchRequest search) throws ElasticClientException
strIndex - The indexsearch - search requestElasticClientException - If a problem occurs connecting Elasticpublic String suggest(String strIndex, AbstractSuggestRequest suggest) throws ElasticClientException
strIndex - The indexsuggest - suggest requetElasticClientException - If a problem occurs connecting Elasticpublic String createMappings(String strIndex, String strJsonMappings) throws ElasticClientException
strIndex - strJsonMappings - ElasticClientExceptionCopyright © 2017 City of Paris. All rights reserved.