@Component public class PuiElasticSearchIndexService extends AbstractPuiElasticSearchService implements IPuiElasticSearchIndexService
daoRegistry, logger, puiElasticSearchEnablement, STRING_SEPARATOR| Constructor and Description |
|---|
PuiElasticSearchIndexService() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkIndexMapping(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass)
Check if the existing index of the given Dto has the same mapping than the
Dto
|
long |
countIndex(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass)
Get the number of indexed documents for the given View DTO Class
|
long |
countIndex(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass,
PuiLanguage language)
Get the number of indexed documents for the given View DTO Class
|
Map<String,Long> |
countIndex(List<String> indexes)
Get the number of registries for the given indexex
|
void |
createIndex(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass)
Create the indexes related with the view that is represented by the given
View DTO Class
|
void |
createIndex(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass,
PuiLanguage language)
Create the index related with the view that is represented by the given View
DTO Class, for the given language
|
void |
deleteIndex(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass)
Delete the indexes related with the view that is represented by the given
View DTO Class
|
void |
deleteIndex(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass,
PuiLanguage language)
Delete the index related with the view that is represented by the given View
DTO Class, for the given language
|
void |
deleteIndex(String index)
Delete the given index
|
boolean |
existsIndex(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass)
Check if the index that belongs to the given View DTO Class exists or not
|
boolean |
existsIndex(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass,
PuiLanguage language)
Check if the index that belongs to the given View DTO Class exists or not,
for the given language
|
List<String> |
getAllIndexes()
Get the list of existing indexes names
|
String |
getIndexPrefix()
Get the index prefix for the indexes of ElasticSearch for this application
|
getClient, getIndexesForDto, getIndexForLanguage, getLanguageFromIndex, isTextTermpublic String getIndexPrefix()
AbstractPuiElasticSearchServicegetIndexPrefix in interface IPuiElasticSearchIndexServicegetIndexPrefix in class AbstractPuiElasticSearchServicepublic void createIndex(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass) throws PuiElasticSearchNoNodesException, PuiElasticSearchCreateIndexException
IPuiElasticSearchIndexServicecreateIndex in interface IPuiElasticSearchIndexServicedtoClass - The View DTO Class that represents the ViewPuiElasticSearchNoNodesException - If Elastic Search is not
connected to any NodePuiElasticSearchCreateIndexException - If any error occurs while
creating the Indexpublic void createIndex(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass, PuiLanguage language) throws PuiElasticSearchNoNodesException, PuiElasticSearchCreateIndexException
IPuiElasticSearchIndexServicecreateIndex in interface IPuiElasticSearchIndexServicedtoClass - The View DTO Class that represents the Viewlanguage - The language that represents the index to be created. May be
null, in that case an index for each existing language will
be createdPuiElasticSearchNoNodesException - If Elastic Search is not
connected to any NodePuiElasticSearchCreateIndexException - If any error occurs while
creating the Indexpublic boolean checkIndexMapping(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass) throws PuiElasticSearchNoNodesException
IPuiElasticSearchIndexServicecheckIndexMapping in interface IPuiElasticSearchIndexServicedtoClass - The View DTO Class that represents the viewPuiElasticSearchNoNodesException - If Elastic Search is not connected
to any Nodepublic void deleteIndex(String index) throws PuiElasticSearchNoNodesException, PuiElasticSearchDeleteIndexException
IPuiElasticSearchIndexServicedeleteIndex in interface IPuiElasticSearchIndexServiceindex - The Index to be deletedPuiElasticSearchNoNodesException - If Elastic Search is not
connected to any NodePuiElasticSearchDeleteIndexException - If any error occurs while
deleting the Indexpublic void deleteIndex(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass) throws PuiElasticSearchNoNodesException, PuiElasticSearchDeleteIndexException
IPuiElasticSearchIndexServicedeleteIndex in interface IPuiElasticSearchIndexServicedtoClass - The View DTO Class that represents the ViewPuiElasticSearchNoNodesException - If Elastic Search is not
connected to any NodePuiElasticSearchDeleteIndexException - If any error occurs while
deleting the Indexpublic void deleteIndex(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass, PuiLanguage language) throws PuiElasticSearchNoNodesException, PuiElasticSearchDeleteIndexException
IPuiElasticSearchIndexServicedeleteIndex in interface IPuiElasticSearchIndexServicedtoClass - The View DTO Class that represents the Viewlanguage - The language that represents the index to be deleted. May be
null, in that case an index for each existing language will
be deletedPuiElasticSearchNoNodesException - If Elastic Search is not
connected to any NodePuiElasticSearchDeleteIndexException - If any error occurs while
creating the Indexpublic boolean existsIndex(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass) throws PuiElasticSearchNoNodesException, PuiElasticSearchExistsIndexException
IPuiElasticSearchIndexServiceexistsIndex in interface IPuiElasticSearchIndexServicedtoClass - The View DTO Class that represents the ViewPuiElasticSearchNoNodesException - If Elastic Search is not
connected to any NodePuiElasticSearchExistsIndexException - If there is a index lack of a
translated Viewpublic boolean existsIndex(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass, PuiLanguage language) throws PuiElasticSearchNoNodesException, PuiElasticSearchExistsIndexException
IPuiElasticSearchIndexServiceexistsIndex in interface IPuiElasticSearchIndexServicedtoClass - The View DTO Class that represents the Viewlanguage - The language that represents the index to be checked. May be
null, in that case an index for each existing language will
be checkedPuiElasticSearchNoNodesException - If Elastic Search is not
connected to any NodePuiElasticSearchExistsIndexException - If the number of existing
indexes and the number of
indexes that should exists is
not equalpublic List<String> getAllIndexes() throws PuiElasticSearchNoNodesException
IPuiElasticSearchIndexServicegetAllIndexes in interface IPuiElasticSearchIndexServicePuiElasticSearchNoNodesException - If Elastic Search is not connected
to any Nodepublic long countIndex(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass) throws PuiElasticSearchNoNodesException, PuiElasticSearchCountException
IPuiElasticSearchIndexServicecountIndex in interface IPuiElasticSearchIndexServicedtoClass - The View DTO Class that represents the ViewPuiElasticSearchNoNodesException - If Elastic Search is not connected
to any NodePuiElasticSearchCountException - If multiple indexes (languages) are
checked and the value is distinct
for each onepublic long countIndex(Class<? extends es.prodevelop.pui9.model.dto.interfaces.IViewDto> dtoClass, PuiLanguage language) throws PuiElasticSearchNoNodesException, PuiElasticSearchCountException
IPuiElasticSearchIndexServicecountIndex in interface IPuiElasticSearchIndexServicedtoClass - The View DTO Class that represents the Viewlanguage - The language that represents the index to be checked. May be
null, in that case an index for each existing language will
be checkedPuiElasticSearchNoNodesException - If Elastic Search is not connected
to any NodePuiElasticSearchCountException - If multiple indexes (languages) are
checked and the value is distinct
for each onepublic Map<String,Long> countIndex(List<String> indexes) throws PuiElasticSearchNoNodesException
IPuiElasticSearchIndexServicecountIndex in interface IPuiElasticSearchIndexServiceindexes - The list of the indexes to retrieve the countPuiElasticSearchNoNodesException - If Elastic Search is not connected
to any NodeCopyright © 2020. All rights reserved.