Class ElasticClient
java.lang.Object
fr.paris.lutece.plugins.identitystore.service.indexer.elastic.client.ElasticClient
-
Constructor Summary
ConstructorsConstructorDescriptionElasticClient(String strServerUrl) ConstructorElasticClient(String strServerUrl, String strServerLogin, String strServerPwd) Basic Authentification constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAliasOnIndex(AliasActions aliasActions) booleanaliasExists(String strAlias) Check if a given alias existsvoidCreate a document of given type into a given index at the given idvoidcreateMappings(String strIndex, String strJsonMappings) voiddeleteAlias(String strIndex, String alias) voiddeleteDocument(String strIndex, String strId) Delete a document based on its id in the indexvoiddeleteIndex(String strIndex) Delete a given indexgetIndexedIdentitiesNumber(String strIndex) voidindexByBulk(String strIndex, List<BulkAction> bulkActions) perform a bulk indexing of documents : this is used for indexing thousand doc with one HTTP callbooleanisAlive()booleanCheck if a given index existsbooleanisWriteable(String strIndex) Check if a given index is not in read only modemultiSearch(String strIndex, List<MultiSearchAction> searchActions) perform a multi search of documents : used to perform several query with a single http callSearch a document of given type into a given indexvoidPartial Updates to DocumentsvoidupdateSettings(String strIndex, String strJsonSettings)
-
Constructor Details
-
ElasticClient
Constructor- Parameters:
strServerUrl- The Elastic server URL
-
ElasticClient
Basic Authentification constructor- Parameters:
strServerUrl- The Elastic server URLstrServerLogin- LoginstrServerPwd- Password
-
-
Method Details
-
create
Create a document of given type into a given index at the given id- Parameters:
strIndex- The indexstrId- The document idobject- The document- Throws:
ElasticClientException- If a problem occurs connecting Elastic
-
indexByBulk
public void indexByBulk(String strIndex, List<BulkAction> bulkActions) throws ElasticClientException perform a bulk indexing of documents : this is used for indexing thousand doc with one HTTP call- Parameters:
strIndex- the elk index namebulkActions- the actions- Throws:
ElasticClientException
-
deleteIndex
Delete a given index- Parameters:
strIndex- The index- Throws:
ElasticClientException- If a problem occurs connecting Elastic
-
deleteDocument
Delete a document based on its id in the index- Parameters:
strIndex- The indexstrId- The id- Throws:
ElasticClientException- If a problem occurs connecting Elastic
-
update
Partial Updates to Documents- Parameters:
strIndex- The indexstrId- The document idobject- The document- Throws:
ElasticClientException- If a problem occurs connecting Elastic
-
get
- Parameters:
strIndex- the index of the documentstrId- the id of the document- Returns:
- the document if any
- Throws:
ElasticClientException
-
isExists
Check if a given index exists- Parameters:
strIndex- The index- Returns:
- if th index exists
- Throws:
ElasticClientException- If a problem occurs connecting Elastic
-
isWriteable
Check if a given index is not in read only mode- Parameters:
strIndex- The index- Returns:
- true if the index exists and is writable
-
search
Search a document of given type into a given index- Parameters:
strIndex- The indexsearch- search request- Returns:
- The JSON response from Elastic
- Throws:
ElasticClientException- If a problem occurs connecting Elastic
-
multiSearch
public Responses multiSearch(String strIndex, List<MultiSearchAction> searchActions) throws ElasticClientException perform a multi search of documents : used to perform several query with a single http call- Parameters:
strIndex- the elk index namesearchActions- the actions- Returns:
- the reponse of Elk server
- Throws:
ElasticClientException
-
createMappings
- Parameters:
strIndex-strJsonMappings-- Throws:
ElasticClientException
-
updateSettings
- Parameters:
strIndex-strJsonSettings-- Throws:
ElasticClientException
-
addAliasOnIndex
- Parameters:
strIndex-alias-- Throws:
ElasticClientException
-
getAlias
- Parameters:
alias-- Returns:
- Throws:
ElasticClientException
-
aliasExists
Check if a given alias exists- Parameters:
strAlias- The indexThe alias- Returns:
- if th index exists
-
deleteAlias
- Parameters:
strIndex-alias-- Throws:
ElasticClientException
-
getIndexedIdentitiesNumber
- Throws:
ElasticClientException
-
isAlive
public boolean isAlive()
-